Struct serde_tagged::de::WithoutTag

source ·
pub struct WithoutTag<V> { /* private fields */ }
Expand description

A SeedFactory implementation that can be used to discard the tag during deserialization.

This implementation creates a seed which deserializes a tagged value with known type and discards the tag.

This is equivalent to the SeedFactory implementation provided for PhantomData and has been added for consistency and clarification.

Implementations§

source§

impl<V> WithoutTag<V>

source

pub fn new() -> Self

Creates a new SeedFactory implementation that deserializes a tagged value with known type and discards its tag.

Trait Implementations§

source§

impl<V> Default for WithoutTag<V>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de, T, V> SeedFactory<'de, T> for WithoutTag<V>
where V: Deserialize<'de>,

§

type Value = V

The type of the value that will be produced by the DeserializeSeed implementation.
§

type Seed = PhantomData<V>

The type of the DeserializeSeed implementation that will be returned by this factory.
source§

fn seed<E>(self, _tag: T) -> Result<Self::Seed, E>
where E: Error,

Returns the seed that should be used to deserialize a value tagged with the given tag.

Auto Trait Implementations§

§

impl<V> Freeze for WithoutTag<V>

§

impl<V> RefUnwindSafe for WithoutTag<V>
where V: RefUnwindSafe,

§

impl<V> Send for WithoutTag<V>
where V: Send,

§

impl<V> Sync for WithoutTag<V>
where V: Sync,

§

impl<V> Unpin for WithoutTag<V>
where V: Unpin,

§

impl<V> UnwindSafe for WithoutTag<V>
where V: 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>,

§

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

§

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.