pub trait Deserializer<'de>: Sized {
    type Error: Error;

Show 22 methods // Required methods fn deserialize_product<V: ProductVisitor<'de>>( self, visitor: V ) -> Result<V::Output, Self::Error>; fn deserialize_sum<V: SumVisitor<'de>>( self, visitor: V ) -> Result<V::Output, Self::Error>; fn deserialize_bool(self) -> Result<bool, Self::Error>; fn deserialize_u8(self) -> Result<u8, Self::Error>; fn deserialize_u16(self) -> Result<u16, Self::Error>; fn deserialize_u32(self) -> Result<u32, Self::Error>; fn deserialize_u64(self) -> Result<u64, Self::Error>; fn deserialize_u128(self) -> Result<u128, Self::Error>; fn deserialize_i8(self) -> Result<i8, Self::Error>; fn deserialize_i16(self) -> Result<i16, Self::Error>; fn deserialize_i32(self) -> Result<i32, Self::Error>; fn deserialize_i64(self) -> Result<i64, Self::Error>; fn deserialize_i128(self) -> Result<i128, Self::Error>; fn deserialize_f32(self) -> Result<f32, Self::Error>; fn deserialize_f64(self) -> Result<f64, Self::Error>; fn deserialize_str<V: SliceVisitor<'de, str>>( self, visitor: V ) -> Result<V::Output, Self::Error>; fn deserialize_bytes<V: SliceVisitor<'de, [u8]>>( self, visitor: V ) -> Result<V::Output, Self::Error>; fn deserialize_array_seed<V: ArrayVisitor<'de, T::Output>, T: DeserializeSeed<'de> + Clone>( self, visitor: V, seed: T ) -> Result<V::Output, Self::Error>; 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>; // Provided methods fn deserialize_str_slice(self) -> Result<&'de str, Self::Error> { ... } fn deserialize_array<V: ArrayVisitor<'de, T>, T: Deserialize<'de>>( self, visitor: V ) -> Result<V::Output, Self::Error> { ... } fn deserialize_map<Vi: MapVisitor<'de, K, V>, K: Deserialize<'de>, V: Deserialize<'de>>( self, visitor: Vi ) -> Result<Vi::Output, Self::Error> { ... }
}
Expand description

A data format that can deserialize any data structure supported by SATS.

The Deserializer trait in SATS performs the same function as serde::Deserializer in serde. See the documentation of serde::Deserializer for more information of the data model.

Implementations of Deserialize map themselves into this data model by passing to the Deserializer a visitor that can receive the necessary types. The kind of visitor depends on the deserialize_* method. Unlike in Serde, there isn’t a single monolithic Visitor trait, but rather, this functionality is split up into more targeted traits such as SumVisitor<'de>.

The lifetime 'de allows us to deserialize lifetime-generic types in a zero-copy fashion.

Required Associated Types§

source

type Error: Error

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

Required Methods§

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.

The entire process of deserializing a sum, starting from deserialize(args...), is roughly:

The data format will also return an object (VariantAccess) that can deserialize the contents of the variant.

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.

The deserialization is provided with a seed value.

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.

The deserialization is provided with kseed and vseed for keys and values respectively.

Provided Methods§

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.

This is typically the same as deserialize_array_seed with an uninteresting seed value.

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.

This is typically the same as deserialize_map_seed with an uninteresting seed value.

Object Safety§

This trait is not object safe.

Implementors§