Skip to main content

Deserializer

Trait Deserializer 

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

    const FLAT_CLASSES: bool;

    // Required methods
    fn src_namespace(&self) -> &str;
    fn dst_namespaces(&self) -> impl Iterator<Item = &str>;
    fn deserialize_any<V>(
        &mut self,
        visitor: V,
    ) -> Result<Option<V::Value>, Self::Error>
       where V: Visitor<'de>;

    // Provided methods
    fn deserialize_class<V>(
        &mut self,
        visitor: V,
    ) -> Result<Option<V::Value>, Self::Error>
       where V: Visitor<'de> { ... }
    fn deserialize_field<V>(
        &mut self,
        visitor: V,
    ) -> Result<Option<V::Value>, Self::Error>
       where V: Visitor<'de> { ... }
    fn deserialize_method<V>(
        &mut self,
        visitor: V,
    ) -> Result<Option<V::Value>, Self::Error>
       where V: Visitor<'de> { ... }
    fn deserialize_method_arg<V>(
        &mut self,
        visitor: V,
    ) -> Result<Option<V::Value>, Self::Error>
       where V: Visitor<'de> { ... }
    fn deserialize_method_var<V>(
        &mut self,
        visitor: V,
    ) -> Result<Option<V::Value>, Self::Error>
       where V: Visitor<'de> { ... }
    fn size_hint(&self) -> (usize, Option<usize>) { ... }
}
Expand description

Deserializer of a mapping file.

Required Associated Constants§

Source

const FLAT_CLASSES: bool

Whether inner classes should be flattened.

Required Associated Types§

Source

type Error: Error

The error type.

Required Methods§

Source

fn src_namespace(&self) -> &str

Returns the source namespace of this mapping.

Source

fn dst_namespaces(&self) -> impl Iterator<Item = &str>

Returns the destination namespaces of this mapping.

Source

fn deserialize_any<V>( &mut self, visitor: V, ) -> Result<Option<V::Value>, Self::Error>
where V: Visitor<'de>,

Seeks for the next entry and passes it into the given visitor.

Provided Methods§

Source

fn deserialize_class<V>( &mut self, visitor: V, ) -> Result<Option<V::Value>, Self::Error>
where V: Visitor<'de>,

Hints the deserializer to deserialize a class.

Source

fn deserialize_field<V>( &mut self, visitor: V, ) -> Result<Option<V::Value>, Self::Error>
where V: Visitor<'de>,

Hints the deserializer to deserialize a field.

Source

fn deserialize_method<V>( &mut self, visitor: V, ) -> Result<Option<V::Value>, Self::Error>
where V: Visitor<'de>,

Hints the deserializer to deserialize a method.

Source

fn deserialize_method_arg<V>( &mut self, visitor: V, ) -> Result<Option<V::Value>, Self::Error>
where V: Visitor<'de>,

Hints the deserializer to deserialize a method argument.

Source

fn deserialize_method_var<V>( &mut self, visitor: V, ) -> Result<Option<V::Value>, Self::Error>
where V: Visitor<'de>,

Hints the deserializer to deserialize a method variable.

Source

fn size_hint(&self) -> (usize, Option<usize>)

Hints the count of remaining top-level entries of this deserializer.

See Iterator::size_hint for more information.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'de, T> Deserializer<'de> for &mut T
where T: Deserializer<'de>,

Source§

const FLAT_CLASSES: bool = T::FLAT_CLASSES

Source§

type Error = <T as Deserializer<'de>>::Error

Source§

fn deserialize_any<V>( &mut self, visitor: V, ) -> Result<Option<V::Value>, Self::Error>
where V: Visitor<'de>,

Source§

fn deserialize_class<V>( &mut self, visitor: V, ) -> Result<Option<V::Value>, Self::Error>
where V: Visitor<'de>,

Source§

fn deserialize_field<V>( &mut self, visitor: V, ) -> Result<Option<V::Value>, Self::Error>
where V: Visitor<'de>,

Source§

fn deserialize_method<V>( &mut self, visitor: V, ) -> Result<Option<V::Value>, Self::Error>
where V: Visitor<'de>,

Source§

fn deserialize_method_arg<V>( &mut self, visitor: V, ) -> Result<Option<V::Value>, Self::Error>
where V: Visitor<'de>,

Source§

fn deserialize_method_var<V>( &mut self, visitor: V, ) -> Result<Option<V::Value>, Self::Error>
where V: Visitor<'de>,

Source§

fn size_hint(&self) -> (usize, Option<usize>)

Source§

fn src_namespace(&self) -> &str

Source§

fn dst_namespaces(&self) -> impl Iterator<Item = &str>

Implementors§