pub trait Reader {
// Required method
fn read_u8(&mut self) -> Result<u8>;
// Provided methods
fn read_presence_map(&mut self) -> Result<(u64, u8)> { ... }
fn read_uint(&mut self) -> Result<u64> { ... }
fn read_uint_nullable(&mut self) -> Result<Option<u64>> { ... }
fn read_int(&mut self) -> Result<i64> { ... }
fn read_int_nullable(&mut self) -> Result<Option<i64>> { ... }
fn read_ascii_string(&mut self) -> Result<String> { ... }
fn read_ascii_string_nullable(&mut self) -> Result<Option<String>> { ... }
fn read_unicode_string(&mut self) -> Result<String> { ... }
fn read_unicode_string_nullable(&mut self) -> Result<Option<String>> { ... }
fn read_bytes(&mut self) -> Result<Vec<u8>> { ... }
fn read_bytes_nullable(&mut self) -> Result<Option<Vec<u8>>> { ... }
}Expand description
A trait that provides methods for reading basic primitive types.
Required Methods§
Sourcefn read_u8(&mut self) -> Result<u8>
fn read_u8(&mut self) -> Result<u8>
Do not return Error::Eof from this method.
Return Error::UnexpectedEof instead.
Provided Methods§
Sourcefn read_presence_map(&mut self) -> Result<(u64, u8)>
fn read_presence_map(&mut self) -> Result<(u64, u8)>
Read the presence map. Return the bitmap and the number of bits in the bitmap.
In case of error, return Error::Eof if the end of the stream is reached at the first byte
of the presence map. Otherwise, return any other error, e.g.: Error::UnexpectedEof.