pub struct ValueDeserializer { /* private fields */ }
Expand description

An implementation of Deserializer where the input of deserialization is an AlgebraicValue.

Implementations§

source§

impl ValueDeserializer

source

pub fn new(val: AlgebraicValue) -> Self

Returns a ValueDeserializer with val as the input for deserialization.

source

pub fn from_ref(val: &AlgebraicValue) -> &Self

Converts &AlgebraicValue to &ValueDeserialize.

Trait Implementations§

source§

impl<'de> Deserializer<'de> for &'de ValueDeserializer

§

type Error = ValueDeserializeError

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

fn deserialize_product<V: ProductVisitor<'de>>( self, visitor: V ) -> Result<V::Output, Self::Error>

Deserializes a product value from the input.
source§

fn deserialize_sum<V: SumVisitor<'de>>( self, visitor: V ) -> Result<V::Output, Self::Error>

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

fn deserialize_bool(self) -> Result<bool, Self::Error>

Deserializes a bool value from the input.
source§

fn deserialize_u8(self) -> Result<u8, Self::Error>

Deserializes a u8 value from the input.
source§

fn deserialize_u16(self) -> Result<u16, Self::Error>

Deserializes a u16 value from the input.
source§

fn deserialize_u32(self) -> Result<u32, Self::Error>

Deserializes a u32 value from the input.
source§

fn deserialize_u64(self) -> Result<u64, Self::Error>

Deserializes a u64 value from the input.
source§

fn deserialize_u128(self) -> Result<u128, Self::Error>

Deserializes a u128 value from the input.
source§

fn deserialize_i8(self) -> Result<i8, Self::Error>

Deserializes an `i8 value from the input.
source§

fn deserialize_i16(self) -> Result<i16, Self::Error>

Deserializes an `i16 value from the input.
source§

fn deserialize_i32(self) -> Result<i32, Self::Error>

Deserializes an `i32 value from the input.
source§

fn deserialize_i64(self) -> Result<i64, Self::Error>

Deserializes an `i64 value from the input.
source§

fn deserialize_i128(self) -> Result<i128, Self::Error>

Deserializes an `i128 value from the input.
source§

fn deserialize_f32(self) -> Result<f32, Self::Error>

Deserializes an `f32 value from the input.
source§

fn deserialize_f64(self) -> Result<f64, Self::Error>

Deserializes an `f64 value from the input.
source§

fn deserialize_str<V: SliceVisitor<'de, str>>( self, visitor: V ) -> Result<V::Output, Self::Error>

Deserializes a string-like object the input.
source§

fn deserialize_bytes<V: SliceVisitor<'de, [u8]>>( self, visitor: V ) -> Result<V::Output, Self::Error>

Deserializes a byte slice-like value.
source§

fn deserialize_array_seed<V: ArrayVisitor<'de, T::Output>, T: DeserializeSeed<'de> + Clone>( self, visitor: V, seed: T ) -> Result<V::Output, Self::Error>

Deserializes an array value. Read more
source§

fn deserialize_map_seed<Vi: MapVisitor<'de, K::Output, V::Output>, K: DeserializeSeed<'de> + Clone, V: DeserializeSeed<'de> + Clone>( self, visitor: Vi, kseed: K, vseed: V ) -> Result<Vi::Output, Self::Error>

Deserializes a map value. Read more
source§

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

Deserializes an &str string value.
source§

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

Deserializes an array value. Read more
source§

fn deserialize_map<Vi: MapVisitor<'de, K, V>, K: Deserialize<'de>, V: Deserialize<'de>>( self, visitor: Vi ) -> Result<Vi::Output, Self::Error>

Deserializes a map value. Read more
source§

impl<'de> Deserializer<'de> for ValueDeserializer

§

type Error = ValueDeserializeError

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

fn deserialize_product<V: ProductVisitor<'de>>( self, visitor: V ) -> Result<V::Output, Self::Error>

Deserializes a product value from the input.
source§

fn deserialize_sum<V: SumVisitor<'de>>( self, visitor: V ) -> Result<V::Output, Self::Error>

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

fn deserialize_bool(self) -> Result<bool, Self::Error>

Deserializes a bool value from the input.
source§

fn deserialize_u8(self) -> Result<u8, Self::Error>

Deserializes a u8 value from the input.
source§

fn deserialize_u16(self) -> Result<u16, Self::Error>

Deserializes a u16 value from the input.
source§

fn deserialize_u32(self) -> Result<u32, Self::Error>

Deserializes a u32 value from the input.
source§

fn deserialize_u64(self) -> Result<u64, Self::Error>

Deserializes a u64 value from the input.
source§

fn deserialize_u128(self) -> Result<u128, Self::Error>

Deserializes a u128 value from the input.
source§

fn deserialize_i8(self) -> Result<i8, Self::Error>

Deserializes an `i8 value from the input.
source§

fn deserialize_i16(self) -> Result<i16, Self::Error>

Deserializes an `i16 value from the input.
source§

fn deserialize_i32(self) -> Result<i32, Self::Error>

Deserializes an `i32 value from the input.
source§

fn deserialize_i64(self) -> Result<i64, Self::Error>

Deserializes an `i64 value from the input.
source§

fn deserialize_i128(self) -> Result<i128, Self::Error>

Deserializes an `i128 value from the input.
source§

fn deserialize_f32(self) -> Result<f32, Self::Error>

Deserializes an `f32 value from the input.
source§

fn deserialize_f64(self) -> Result<f64, Self::Error>

Deserializes an `f64 value from the input.
source§

fn deserialize_str<V: SliceVisitor<'de, str>>( self, visitor: V ) -> Result<V::Output, Self::Error>

Deserializes a string-like object the input.
source§

fn deserialize_bytes<V: SliceVisitor<'de, [u8]>>( self, visitor: V ) -> Result<V::Output, Self::Error>

Deserializes a byte slice-like value.
source§

fn deserialize_array_seed<V: ArrayVisitor<'de, T::Output>, T: DeserializeSeed<'de> + Clone>( self, visitor: V, seed: T ) -> Result<V::Output, Self::Error>

Deserializes an array value. Read more
source§

fn deserialize_map_seed<Vi: MapVisitor<'de, K::Output, V::Output>, K: DeserializeSeed<'de> + Clone, V: DeserializeSeed<'de> + Clone>( self, visitor: Vi, kseed: K, vseed: V ) -> Result<Vi::Output, Self::Error>

Deserializes a map value. Read more
source§

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

Deserializes an &str string value.
source§

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

Deserializes an array value. Read more
source§

fn deserialize_map<Vi: MapVisitor<'de, K, V>, K: Deserialize<'de>, V: Deserialize<'de>>( self, visitor: Vi ) -> Result<Vi::Output, Self::Error>

Deserializes a map value. Read more
source§

impl From<AlgebraicValue> for ValueDeserializer

source§

fn from(original: AlgebraicValue) -> ValueDeserializer

Converts to this type from the input type.
source§

impl<'de> VariantAccess<'de> for &'de ValueDeserializer

§

type Error = ValueDeserializeError

source§

fn deserialize_seed<T: DeserializeSeed<'de>>( self, seed: T ) -> Result<T::Output, Self::Error>

Called when deserializing the contents of a sum variant, and provided with a seed value.
source§

fn deserialize<T: Deserialize<'de>>(self) -> Result<T, Self::Error>

Called when deserializing the contents of a sum variant. Read more
source§

impl<'de> VariantAccess<'de> for ValueDeserializer

§

type Error = ValueDeserializeError

source§

fn deserialize_seed<T: DeserializeSeed<'de>>( self, seed: T ) -> Result<T::Output, Self::Error>

Called when deserializing the contents of a sum variant, and provided with a seed value.
source§

fn deserialize<T: Deserialize<'de>>(self) -> Result<T, Self::Error>

Called when deserializing the contents of a sum variant. Read more

Auto Trait Implementations§

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

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

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more