pub trait RmpRead: Sealed {
type Error: RmpReadErr;
// Required method
fn read_exact_buf(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>;
// Provided method
fn read_u8(&mut self) -> Result<u8, Self::Error> { ... }
}
Expand description
A type that rmp
supports reading from.
The methods of this trait should be considered an implementation detail (for now). It is currently sealed (can not be implemented by the user).
See also std::io::Read
and byteorder::ReadBytesExt
Its primary implementations are std::io::Read
and Bytes.
Required Associated Types§
type Error: RmpReadErr
Required Methods§
sourcefn read_exact_buf(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
fn read_exact_buf(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
Read the exact number of bytes needed to fill the specified buffer.
If there are not enough bytes, this will return an error.
See also std::io::Read::read_exact