Struct Enum

Source
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>

Source§

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>

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>,

variant is called to identify which variant to deserialize. Read more
Source§

fn variant<V>(self) -> Result<(V, Self::Variant), Self::Error>
where V: Deserialize<'de>,

variant is called to identify which variant to deserialize. Read more
Source§

impl<'de, D, F> VariantAccess<'de> for Enum<D, F>
where D: Deserializer<'de, Error = Error>,

Source§

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>

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>,

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>,

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>,

Called when deserializing a struct-like variant. Read more
Source§

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>

§

impl<D, F> Send for Enum<D, F>
where D: Send, F: Send,

§

impl<D, F> Sync for Enum<D, F>
where D: Sync, F: Sync,

§

impl<D, F> Unpin for Enum<D, F>
where D: Unpin, F: Unpin,

§

impl<D, F> UnwindSafe for Enum<D, F>
where D: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.