pub(crate) struct Enum<D, F> {
pub(crate) de: D,
pub(crate) name: &'static str,
pub(crate) _phantom: PhantomData<F>,
}
Fields§
§de: D
§name: &'static str
§_phantom: PhantomData<F>
Trait Implementations§
Source§impl<'de, F: AsFd> EnumAccess<'de> for Enum<&mut Deserializer<'de, '_, '_, F>, F>
impl<'de, F: AsFd> EnumAccess<'de> for Enum<&mut Deserializer<'de, '_, '_, F>, F>
Source§type Error = Error
type Error = Error
The error type that can be returned if some error occurs during
deserialization.
Source§type Variant = Enum<&mut Deserializer<'de, '_, '_, F>, F>
type Variant = Enum<&mut Deserializer<'de, '_, '_, F>, F>
The
Visitor
that will be used to deserialize the content of the enum
variant.Source§fn variant_seed<V>(self, seed: V) -> Result<(V::Value, Self::Variant)>where
V: DeserializeSeed<'de>,
fn variant_seed<V>(self, seed: V) -> Result<(V::Value, Self::Variant)>where
V: DeserializeSeed<'de>,
variant
is called to identify which variant to deserialize. Read moreSource§impl<'de, D, F> VariantAccess<'de> for Enum<D, F>where
D: Deserializer<'de, Error = Error>,
impl<'de, D, F> VariantAccess<'de> for Enum<D, F>where
D: Deserializer<'de, Error = Error>,
Source§type Error = Error
type Error = Error
The error type that can be returned if some error occurs during
deserialization. Must match the error type of our
EnumAccess
.Source§fn unit_variant(self) -> Result<(), Self::Error>
fn unit_variant(self) -> Result<(), Self::Error>
Called when deserializing a variant with no values. Read more
Source§fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value>where
T: DeserializeSeed<'de>,
fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value>where
T: DeserializeSeed<'de>,
Called when deserializing a variant with a single value. Read more
Source§fn tuple_variant<V>(self, _len: usize, visitor: V) -> Result<V::Value>where
V: Visitor<'de>,
fn tuple_variant<V>(self, _len: usize, visitor: V) -> Result<V::Value>where
V: Visitor<'de>,
Called when deserializing a tuple-like variant. Read more
Source§fn struct_variant<V>(
self,
fields: &'static [&'static str],
visitor: V,
) -> Result<V::Value>where
V: Visitor<'de>,
fn struct_variant<V>(
self,
fields: &'static [&'static str],
visitor: V,
) -> Result<V::Value>where
V: Visitor<'de>,
Called when deserializing a struct-like variant. Read more
Source§fn newtype_variant<T>(self) -> Result<T, Self::Error>where
T: Deserialize<'de>,
fn newtype_variant<T>(self) -> Result<T, Self::Error>where
T: Deserialize<'de>,
Called when deserializing a variant with a single value. Read more
Auto Trait Implementations§
impl<D, F> Freeze for Enum<D, F>where
D: Freeze,
impl<D, F> RefUnwindSafe for Enum<D, F>where
D: RefUnwindSafe,
F: RefUnwindSafe,
impl<D, F> Send for Enum<D, F>
impl<D, F> Sync for Enum<D, F>
impl<D, F> Unpin for Enum<D, F>
impl<D, F> UnwindSafe for Enum<D, F>where
D: UnwindSafe,
F: 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