King Charles III has written privately to Mark Carney as he was sworn in as Canada’s new prime minister, it is understood.