[−][src]Trait spectrusty_formats::ReadExactEx
A trait that extends Read with methods that ease reading from chunked files.
Provided methods
pub fn read_exact_or_to_end(&mut self, mut buf: &mut [u8]) -> Result<usize>
[src]
Reads all bytes to fill buf
or until EOF. If successful, returns the total number of bytes read.
This function behaves like Read::read_to_end but it reads data into the mutable slice
instead of into a Vec and stops reading when the whole buf
has been filled.
pub fn read_exact_or_none(&mut self, buf: &mut [u8]) -> Result<bool>
[src]
Reads the exact number of bytes required to fill buf
and returns Ok(true)
or returns
Ok(false)
if exactly zero bytes were read. In this instance, buf
will be left unmodified.
If at least one byte was read, this function behaves exactly like Read::read_exact.