pub enum MsgraphField<T> {
Unset,
Null,
Set(T),
}Expand description
A writable Microsoft Graph resource field: absent from the serialized body, explicitly null, or set to a value.
Graph PATCH semantics make the three states meaningful: an omitted
field keeps its stored value, a null one is cleared, a present one
is replaced. Collections clear through either Null or Set of an
empty collection (an explicit [] on the wire). Deserialization
maps a JSON null onto Null and a missing field onto Unset (via
the serde default).
Variants§
Unset
Left out of the serialized body; an update preserves the stored value.
Null
Serialized as an explicit null; an update clears the stored value.
Set(T)
Serialized as the value itself.
Implementations§
Source§impl<T> MsgraphField<T>
impl<T> MsgraphField<T>
Sourcepub fn into_option(self) -> Option<T>
pub fn into_option(self) -> Option<T>
The set value by value, None for both unset and null.
Sourcepub fn set_or_null(value: Option<T>) -> Self
pub fn set_or_null(value: Option<T>) -> Self
Set for Some, Null for None.
This is the natural encoding of a full-state update body, where every managed field is either replaced or cleared.
Trait Implementations§
Source§impl<T: Clone> Clone for MsgraphField<T>
impl<T: Clone> Clone for MsgraphField<T>
Source§fn clone(&self) -> MsgraphField<T>
fn clone(&self) -> MsgraphField<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more