Trait Deserializer

Source
pub trait Deserializer: Sized {
    // Required method
    fn deserialize<R: Read>(reader: &mut R) -> Result<Self>;

    // Provided method
    fn try_from_slice(slice: &[u8]) -> Result<Self> { ... }
}

Required Methods§

Source

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Provided Methods§

Source

fn try_from_slice(slice: &[u8]) -> Result<Self>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Deserializer for String

Source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<K, V> Deserializer for BTreeMap<K, V>
where K: Deserializer + Ord, V: Deserializer,

Source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<K, V> Deserializer for HashMap<K, V>
where K: Deserializer + Hash + Eq, V: Deserializer,

Source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<K, V> Deserializer for AHashMap<K, V>
where K: Deserializer + Send + Sync + Hash + Eq, V: Deserializer + Send + Sync,

Source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T> Deserializer for Option<T>
where T: Deserializer + 'static,

Source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T> Deserializer for BTreeSet<T>
where T: Deserializer + Ord,

Source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T> Deserializer for HashSet<T>
where T: Deserializer + Send + Sync + Hash + Eq,

Source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T> Deserializer for AHashSet<T>
where T: Deserializer + Hash + Eq,

Source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T, E> Deserializer for Result<T, E>
where T: Deserializer + 'static, E: Display + BorshDeserialize + 'static,

Source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<V> Deserializer for Vec<V>
where V: Deserializer,

Source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Implementors§

Source§

impl<T> Deserializer for Payload<T>
where T: Deserializer,