pub trait Deserializer<T>: Send + Sync {
    // Required method
    fn deserialize(&self, data: &[u8]) -> Result<T>;
}
Expand description

A deserializer interface that can be used to deserialize a byte array into an instance of a specific Rust data type from a specific wire format.

Required Methods§

source

fn deserialize(&self, data: &[u8]) -> Result<T>

Deserializes the given value from a message encoded in the wire format supported by this implementation.

§Errors

An error (anyhow::Error) is returned in case the deserialization could not succeed as expected.

Implementors§

source§

impl<In, Out, S> Deserializer<In> for Convert<In, Out, S>
where In: TryFrom<Out> + Send + Sync, Out: TryFrom<In> + Send + Sync, <In as TryFrom<Out>>::Error: Display, S: Serde<Out> + Send + Sync,

source§

impl<T> Deserializer<T> for Json<T>
where for<'d> T: Serialize + Send + Sync + Deserialize<'d>,

source§

impl<T> Deserializer<T> for ProtoJson<T>
where for<'de> T: Message + Serialize + Default + Deserialize<'de>,

source§

impl<T> Deserializer<T> for Protobuf<T>
where T: Message + Default,