Skip to main content

SizedDeserialize

Trait SizedDeserialize 

Source
pub trait SizedDeserialize<R>: Deserialize<R> + Sized
where R: Read,
{ // Required method fn deserialize_sized( d: &mut Deserializer<R>, size: usize, ) -> BinverseResult<Self>; }
Expand description

Similar to the Deserialize trait, but for data structures with a variable length, like arrays, Vecs, and Strings.

Required Methods§

Source

fn deserialize_sized( d: &mut Deserializer<R>, size: usize, ) -> BinverseResult<Self>

Reads size elements into a new instance of the data structure. To read a length stored in the data being deserialize, use crate::streams::Deserializer::deserialize_sized. Arguments:

  • d - The deserializer that the data will be written to.
  • size - The number of elements to read

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<R: Read, K: Deserialize<R> + Eq + Hash, V: Deserialize<R>> SizedDeserialize<R> for HashMap<K, V>

Source§

impl<R: Read, T: Deserialize<R>> SizedDeserialize<R> for Vec<T>

Source§

impl<R: Read> SizedDeserialize<R> for String

Implementors§