Skip to main content

UnitAccess

Struct UnitAccess 

Source
pub struct UnitAccess<E>(/* private fields */);
Expand description

A Deserializer that represents a unit value.

Implementations§

Source§

impl<E> UnitAccess<E>
where E: Error,

Source

pub fn new() -> UnitAccess<E>

Returns a new UnitAccess.

Trait Implementations§

Source§

impl<E> Default for UnitAccess<E>
where E: Error,

Source§

fn default() -> UnitAccess<E>

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

impl<'de, E> Deserializer<'de> for UnitAccess<E>
where E: Error,

Source§

type Error = E

The error type that can be returned if some error occurs during deserialization.
Source§

fn deserialize_product<V>( self, visitor: V, ) -> Result<<V as ProductVisitor<'de>>::Output, <UnitAccess<E> as Deserializer<'de>>::Error>
where V: ProductVisitor<'de>,

Deserializes a product value from the input.
Source§

fn deserialize_sum<V>( self, _visitor: V, ) -> Result<<V as SumVisitor<'de>>::Output, <UnitAccess<E> as Deserializer<'de>>::Error>
where V: SumVisitor<'de>,

Deserializes a sum value from the input. Read more
Source§

fn deserialize_bool( self, ) -> Result<bool, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes a bool value from the input.
Source§

fn deserialize_u8( self, ) -> Result<u8, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes a u8 value from the input.
Source§

fn deserialize_u16( self, ) -> Result<u16, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes a u16 value from the input.
Source§

fn deserialize_u32( self, ) -> Result<u32, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes a u32 value from the input.
Source§

fn deserialize_u64( self, ) -> Result<u64, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes a u64 value from the input.
Source§

fn deserialize_u128( self, ) -> Result<u128, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes a u128 value from the input.
Source§

fn deserialize_u256( self, ) -> Result<U256, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes a u256 value from the input.
Source§

fn deserialize_i8( self, ) -> Result<i8, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes an i8 value from the input.
Source§

fn deserialize_i16( self, ) -> Result<i16, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes an i16 value from the input.
Source§

fn deserialize_i32( self, ) -> Result<i32, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes an i32 value from the input.
Source§

fn deserialize_i64( self, ) -> Result<i64, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes an i64 value from the input.
Source§

fn deserialize_i128( self, ) -> Result<i128, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes an i128 value from the input.
Source§

fn deserialize_i256( self, ) -> Result<I256, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes an i256 value from the input.
Source§

fn deserialize_f32( self, ) -> Result<f32, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes an f32 value from the input.
Source§

fn deserialize_f64( self, ) -> Result<f64, <UnitAccess<E> as Deserializer<'de>>::Error>

Deserializes an f64 value from the input.
Source§

fn deserialize_str<V>( self, _visitor: V, ) -> Result<<V as SliceVisitor<'de, str>>::Output, <UnitAccess<E> as Deserializer<'de>>::Error>
where V: SliceVisitor<'de, str>,

Deserializes a string-like object the input.
Source§

fn deserialize_bytes<V>( self, _visitor: V, ) -> Result<<V as SliceVisitor<'de, [u8]>>::Output, <UnitAccess<E> as Deserializer<'de>>::Error>
where V: SliceVisitor<'de, [u8]>,

Deserializes a byte slice-like value.
Source§

fn deserialize_array_seed<V, T>( self, _visitor: V, _seed: T, ) -> Result<<V as ArrayVisitor<'de, <T as DeserializeSeed<'de>>::Output>>::Output, <UnitAccess<E> as Deserializer<'de>>::Error>
where V: ArrayVisitor<'de, <T as DeserializeSeed<'de>>::Output>, T: DeserializeSeed<'de> + Clone,

Deserializes an array value. Read more
Source§

fn deserialize_str_slice(self) -> Result<&'de str, Self::Error>

Deserializes an &str string value.
Source§

fn deserialize_array<V, T>( self, visitor: V, ) -> Result<<V as ArrayVisitor<'de, T>>::Output, Self::Error>
where V: ArrayVisitor<'de, T>, T: Deserialize<'de>,

Deserializes an array value. Read more
Source§

impl<'de, E> NamedProductAccess<'de> for UnitAccess<E>
where E: Error,

Source§

type Error = E

The error type that can be returned if some error occurs during deserialization.
Source§

fn get_field_ident<V>( &mut self, _visitor: V, ) -> Result<Option<<V as FieldNameVisitor<'de>>::Output>, <UnitAccess<E> as NamedProductAccess<'de>>::Error>
where V: FieldNameVisitor<'de>,

Deserializes field name of type V::Output from the input using a visitor provided by the deserializer.
Source§

fn get_field_value_seed<T>( &mut self, _seed: T, ) -> Result<<T as DeserializeSeed<'de>>::Output, <UnitAccess<E> as NamedProductAccess<'de>>::Error>
where T: DeserializeSeed<'de>,

Statefully deserializes the field value T::Output from the input provided a seed value. Read more
Source§

fn get_field_value<T>(&mut self) -> Result<T, Self::Error>
where T: Deserialize<'de>,

Deserializes field value of type T from the input. Read more
Source§

impl<'de, E> SeqProductAccess<'de> for UnitAccess<E>
where E: Error,

Source§

type Error = E

The error type that can be returned if some error occurs during deserialization.
Source§

fn next_element_seed<T>( &mut self, _seed: T, ) -> Result<Option<<T as DeserializeSeed<'de>>::Output>, <UnitAccess<E> as SeqProductAccess<'de>>::Error>
where T: DeserializeSeed<'de>,

Statefully deserializes T::Output from the input provided a seed value. Read more
Source§

fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error>
where T: Deserialize<'de>,

Deserializes an T from the input. Read more

Auto Trait Implementations§

§

impl<E> Freeze for UnitAccess<E>

§

impl<E> RefUnwindSafe for UnitAccess<E>
where E: RefUnwindSafe,

§

impl<E> Send for UnitAccess<E>
where E: Send,

§

impl<E> Sync for UnitAccess<E>
where E: Sync,

§

impl<E> Unpin for UnitAccess<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for UnitAccess<E>

§

impl<E> UnwindSafe for UnitAccess<E>
where E: 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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.