pub trait Deserializer {
// Required methods
fn read_u64(&mut self) -> u64;
fn read_f32(&mut self) -> f32;
fn read_bytes(&mut self, len: usize) -> Vec<u8> ⓘ;
// Provided method
fn remaining(&self) -> Option<usize> { ... }
}Expand description
A source for the primitive field types the container reads back.
The order of reads matches the order of writes in Serializer.
Required Methods§
Provided Methods§
Sourcefn remaining(&self) -> Option<usize>
fn remaining(&self) -> Option<usize>
Bytes still available to read, when the source knows its length.
A variable-length Deserialize impl checks this before allocating a
buffer sized by a length read from the input. A source that cannot report
its length returns None, and the impl allocates as before. The default
returns None.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".