bookdata::io::ext

Trait LengthRead

Source
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§

Provided Methods§

Source

fn read_all_sized(&mut self) -> Result<Vec<u8>>

Read all bytes from a file, using its size to pre-allocate capacity.

Implementations on Foreign Types§

Source§

impl LengthRead for File

Source§

impl<'a> LengthRead for ZipFile<'a>

Implementors§