pub struct Deserializer<'a, R> { /* private fields */ }
Expand description

Deserializer from the BSATN data format.

Implementations§

source§

impl<'a, 'de, R: BufReader<'de>> Deserializer<'a, R>

source

pub fn new(reader: &'a mut R) -> Self

Returns a deserializer using the given reader.

Trait Implementations§

source§

impl<'de, 'a, R: BufReader<'de>> Deserializer<'de> for Deserializer<'a, R>

§

type Error = DecodeError

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

Deserializes a product value from the input.
source§

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

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

Deserializes a u8 value from the input.
source§

fn deserialize_u16(self) -> Result<u16, DecodeError>

Deserializes a u16 value from the input.
source§

fn deserialize_u32(self) -> Result<u32, DecodeError>

Deserializes a u32 value from the input.
source§

fn deserialize_u64(self) -> Result<u64, DecodeError>

Deserializes a u64 value from the input.
source§

fn deserialize_u128(self) -> Result<u128, DecodeError>

Deserializes a u128 value from the input.
source§

fn deserialize_i8(self) -> Result<i8, DecodeError>

Deserializes an `i8 value from the input.
source§

fn deserialize_i16(self) -> Result<i16, DecodeError>

Deserializes an `i16 value from the input.
source§

fn deserialize_i32(self) -> Result<i32, DecodeError>

Deserializes an `i32 value from the input.
source§

fn deserialize_i64(self) -> Result<i64, DecodeError>

Deserializes an `i64 value from the input.
source§

fn deserialize_i128(self) -> Result<i128, DecodeError>

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, 'a, R: BufReader<'de>> SeqProductAccess<'de> for Deserializer<'a, R>

§

type Error = DecodeError

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

fn next_element_seed<T: DeserializeSeed<'de>>( &mut self, seed: T ) -> Result<Option<T::Output>, DecodeError>

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

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

Deserializes an T from the input. Read more
source§

impl<'de, 'a, R: BufReader<'de>> SumAccess<'de> for Deserializer<'a, R>

§

type Error = DecodeError

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

type Variant = Deserializer<'a, R>

The visitor used to deserialize the content of the sum variant.
source§

fn variant<V: VariantVisitor>( self, visitor: V ) -> Result<(V::Output, Self::Variant), Self::Error>

Called to identify which variant to deserialize. Returns a tuple with the result of identification (V::Output) and the input to variant data deserialization. Read more
source§

impl<'de, 'a, R: BufReader<'de>> VariantAccess<'de> for Deserializer<'a, R>

§

type Error = DecodeError

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§

§

impl<'a, R> RefUnwindSafe for Deserializer<'a, R>
where R: RefUnwindSafe,

§

impl<'a, R> Send for Deserializer<'a, R>
where R: Send,

§

impl<'a, R> Sync for Deserializer<'a, R>
where R: Sync,

§

impl<'a, R> Unpin for Deserializer<'a, R>

§

impl<'a, R> !UnwindSafe for Deserializer<'a, R>

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