Image copyright EPA

For any prime minister, handling a president like Donald Trump is like trying to hold on to a Ming vase walking across a recently polished, slippery parquet floor.

He's a leader who glories in the unpredictable, who seems to wake up every morning wondering what controversy he can provoke, what headlines he can create.

His reason for being is therefore from the start in contrast with the stiff choreography of a state visit.

But No 10 will be relieved that the formalities with the PM today were free of mishap. And, as Theresa May readies herself for the exit, Donald Trump, who has definitely embarrassed her in the past, didn't repeat that habit today.

Instead, he spoke warmly of her, suggesting that history may judge her much more kindly than the manner of her departure suggests.

But some of the most notable remarks were not related to the prime minister in any case, but to what's next.

Whether you are overjoyed about Theresa May leaving or not, it is telling that the three names Donald Trump mentioned immediately when asked about the next leader were Boris Johnson, Jeremy Hunt, and Michael Gove, categorising them deliberately or not as the three most likely candidates to win the keys to No 10.

All three have been invited to meet Donald Trump. You wouldn't expect the US president to invite the football team of candidates for the job to spend time with him on this visit. But it's notable that neither Sajid Javid nor Matt Hancock - both cabinet contenders - received invites to talk or to meet. Nor did one of the other Brexiteer frontrunners, Dominic Raab.

Of course, smart candidates could even turn the lack of invitation to their advantage. Donald Trump won't of course have a say in this race and he is such a Marmite politician that chumming up to him is not necessarily an advantage for any of the wannabes.

But the invite list does tell us something about the state of the race right now. And in the next 24 hours we'll see whom, beyond Nigel Farage, the president actually meets one-on-one.

The other striking note was not about Theresa May either, even though, as her last big appearance alongside a foreign leader it was, in a way, a very grand leaving do. Instead, it was the Labour leader who featured.

It's not exactly surprising that the two men would not be bosom buddies. Politically they have a greater distance between them than the width of the Atlantic.

Mr Trump revealed not just (no real surprise) that he doesn't think much of Jeremy Corbyn, apt when Jeremy Corbyn doesn't think much of him either. He also revealed that Mr Corbyn had asked him to meet and that he, after considering his request, had decided not to do so.

The Labour leader has always said that he is interested in dialogue. But his position does appear rather curious.

Mr Corbyn chose very publicly not to attend the dinner for Mr Trump last night at the Queen's invitiation. He then led - very publicly - the protests against the president today. Yet we now know that he had actually asked for a meeting of his own, but was then rebuffed.

Diplomacy, or the lack of it, can be a complicated business. We've learnt that from observing Donald Trump and Theresa May over the last few years.

But those pitfalls won't disappear when the prime minister does. Now Jeremy Corbyn and the contenders for the Tory crown are all too aware of that.