Skip to main content

present

Function present 

Source
fn present<'de, D, T>(de: D) -> Result<Option<T>, D::Error>
where D: Deserializer<'de>, T: Deserialize<'de>,
Expand description

Reads a field that may be present and null.

Option<Option<T>> with this on it distinguishes an absent key from one written as null, which Option<T> alone cannot. putRecord declares swapRecord nullable and an explicit null there means “assert this record does not exist yet” – a different request from not asking at all, and one this server has to be able to see in order to refuse it.