pub struct NoneAccess<E>(/* private fields */);Expand description
Deserializes none variant of an optional value.
Implementations§
Source§impl<E> NoneAccess<E>where
E: Error,
impl<E> NoneAccess<E>where
E: Error,
Sourcepub fn new() -> NoneAccess<E>
pub fn new() -> NoneAccess<E>
Returns a new NoneAccess.
Trait Implementations§
Source§impl<E> Default for NoneAccess<E>where
E: Error,
impl<E> Default for NoneAccess<E>where
E: Error,
Source§fn default() -> NoneAccess<E>
fn default() -> NoneAccess<E>
Returns the “default value” for a type. Read more
Source§impl<'de, E> SumAccess<'de> for NoneAccess<E>where
E: Error,
impl<'de, E> SumAccess<'de> for NoneAccess<E>where
E: Error,
Source§type Error = E
type Error = E
The error type that can be returned if some error occurs during deserialization.
Source§type Variant = NoneAccess<E>
type Variant = NoneAccess<E>
The visitor used to deserialize the content of the sum variant.
Source§fn variant<V>(
self,
visitor: V,
) -> Result<(<V as VariantVisitor<'de>>::Output, <NoneAccess<E> as SumAccess<'de>>::Variant), <NoneAccess<E> as SumAccess<'de>>::Error>where
V: VariantVisitor<'de>,
fn variant<V>(
self,
visitor: V,
) -> Result<(<V as VariantVisitor<'de>>::Output, <NoneAccess<E> as SumAccess<'de>>::Variant), <NoneAccess<E> as SumAccess<'de>>::Error>where
V: VariantVisitor<'de>,
Called to identify which variant to deserialize.
Returns a tuple with the result of identification (
V::Output)
and the input to variant data deserialization. Read moreSource§impl<'de, E> VariantAccess<'de> for NoneAccess<E>where
E: Error,
impl<'de, E> VariantAccess<'de> for NoneAccess<E>where
E: Error,
type Error = E
Source§fn deserialize_seed<T>(
self,
seed: T,
) -> Result<<T as DeserializeSeed<'de>>::Output, <NoneAccess<E> as VariantAccess<'de>>::Error>where
T: DeserializeSeed<'de>,
fn deserialize_seed<T>(
self,
seed: T,
) -> Result<<T as DeserializeSeed<'de>>::Output, <NoneAccess<E> as VariantAccess<'de>>::Error>where
T: DeserializeSeed<'de>,
Called when deserializing the contents of a sum variant, and provided with a
seed value.Source§fn deserialize<T>(self) -> Result<T, Self::Error>where
T: Deserialize<'de>,
fn deserialize<T>(self) -> Result<T, Self::Error>where
T: Deserialize<'de>,
Called when deserializing the contents of a sum variant. Read more
Auto Trait Implementations§
impl<E> Freeze for NoneAccess<E>
impl<E> RefUnwindSafe for NoneAccess<E>where
E: RefUnwindSafe,
impl<E> Send for NoneAccess<E>where
E: Send,
impl<E> Sync for NoneAccess<E>where
E: Sync,
impl<E> Unpin for NoneAccess<E>where
E: Unpin,
impl<E> UnwindSafe for NoneAccess<E>where
E: 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more