pub trait BorrowReader<'storage>: Reader {
    fn take_bytes(
        &mut self,
        length: usize
    ) -> Result<&'storage [u8], DecodeError>; }
Expand description

A reader for borrowed data. Implementors of this must also implement the Reader trait. See the module documentation for more information.

Required Methods

Read exactly length bytes and return a slice to this data. If not enough bytes could be read, an error should be returned.

note: Exactly length bytes must be returned. If less bytes are returned, bincode may panic. If more bytes are returned, the excess bytes may be discarded.

Implementors