pub trait LengthRead: Read {
// Required method
fn input_size(&self) -> Result<u64>;
// Provided method
fn read_all_sized(&mut self) -> Result<Vec<u8>> { ... }
}
Expand description
Trait for read types that can report their size.
Required Methods§
fn input_size(&self) -> Result<u64>
Provided Methods§
Sourcefn read_all_sized(&mut self) -> Result<Vec<u8>>
fn read_all_sized(&mut self) -> Result<Vec<u8>>
Read all bytes from a file, using its size to pre-allocate capacity.