pub struct NullableDeserializeSeed<S>(pub S);Available on crate feature
json only.Expand description
DeserializeSeed that detects JSON null and returns None instead of
delegating to the inner seed. Used by generated oneof deserializers so
that null means “this variant is not set”, and by the opt_* modules so
that null means “this field is not set”.
Tuple Fields§
§0: STrait Implementations§
Source§impl<'de, S> DeserializeSeed<'de> for NullableDeserializeSeed<S>where
S: DeserializeSeed<'de>,
impl<'de, S> DeserializeSeed<'de> for NullableDeserializeSeed<S>where
S: DeserializeSeed<'de>,
Source§fn deserialize<D: Deserializer<'de>>(
self,
d: D,
) -> Result<Self::Value, D::Error>
fn deserialize<D: Deserializer<'de>>( self, d: D, ) -> Result<Self::Value, D::Error>
Equivalent to the more common
Deserialize::deserialize method, except
with some initial piece of data (the seed) passed in.Auto Trait Implementations§
impl<S> Forget for NullableDeserializeSeed<S>
impl<S> Freeze for NullableDeserializeSeed<S>where
S: Freeze,
impl<S> Move for NullableDeserializeSeed<S>
impl<S> RefUnwindSafe for NullableDeserializeSeed<S>where
S: RefUnwindSafe,
impl<S> Send for NullableDeserializeSeed<S>where
S: Send,
impl<S> Sync for NullableDeserializeSeed<S>where
S: Sync,
impl<S> Unpin for NullableDeserializeSeed<S>where
S: Unpin,
impl<S> UnsafeUnpin for NullableDeserializeSeed<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for NullableDeserializeSeed<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more