Trait bincode::BincodeRead [−][src]
pub trait BincodeRead<'storage>: Read { fn forward_read_str<V>(
&mut self,
length: usize,
visitor: V
) -> Result<V::Value>
where
V: Visitor<'storage>; fn get_byte_buffer(&mut self, length: usize) -> Result<Vec<u8>>; fn forward_read_bytes<V>(
&mut self,
length: usize,
visitor: V
) -> Result<V::Value>
where
V: Visitor<'storage>; }
An optional Read trait for advanced Bincode usage.
It is highly recommended to use bincode with io::Read
or &[u8]
before
implementing a custom BincodeRead
.
Required Methods
fn forward_read_str<V>(&mut self, length: usize, visitor: V) -> Result<V::Value> where
V: Visitor<'storage>,
V: Visitor<'storage>,
Forwards reading length
bytes of a string on to the serde reader.
fn get_byte_buffer(&mut self, length: usize) -> Result<Vec<u8>>
Return the first length
bytes of the internal byte buffer.
fn forward_read_bytes<V>(
&mut self,
length: usize,
visitor: V
) -> Result<V::Value> where
V: Visitor<'storage>,
&mut self,
length: usize,
visitor: V
) -> Result<V::Value> where
V: Visitor<'storage>,
Forwards reading length
bytes on to the serde reader.