Trait dialectic_tokio_serde::Deserializer[][src]

pub trait Deserializer<Input> {
    type Error;
    fn deserialize<T: for<'a> Deserialize<'a>>(
        &mut self,
        src: &Input
    ) -> Result<T, Self::Error>; }

The deserialization end of a serialization format: an object which can deserialize to any non-lifetime-restricted Deserialize value.

This trait resembles serde::Deserializer, but is not identical to it. Unlike serde::Deserializer, it is parameterized by the Input to a deserializer, which might be something like Bytes, String, or another input format.

Most serde::Deserializers can be easily given an instance of Deserializer. When implementing this trait, you should usually be as general as possible for the Input parameter. Consider whether you can implement it for all AsRef<[u8]> or AsRef<str> rather than a single concrete input format.

Associated Types

type Error[src]

The type of errors during deserialization.

Loading content...

Required methods

fn deserialize<T: for<'a> Deserialize<'a>>(
    &mut self,
    src: &Input
) -> Result<T, Self::Error>
[src]

Deserialize any Deserialize value from the input format (e.g. Bytes, String, etc.), provided that the deserialized value can live forever.

Loading content...

Implementors

Loading content...