Trait ReadVariable

Source
pub trait ReadVariable: Sized {
    // Required method
    fn read_variable_bytes_with_callback<F, R: Read>(
        reader: &mut R,
        callback: F,
        length: usize,
    ) -> Result<Self>
       where F: Fn(&mut [u8]);

    // Provided method
    fn read_variable_bytes<R: Read>(
        reader: &mut R,
        length: usize,
    ) -> Result<Self> { ... }
}
Expand description

This trait is to read a variable-length array.

Required Methods§

Source

fn read_variable_bytes_with_callback<F, R: Read>( reader: &mut R, callback: F, length: usize, ) -> Result<Self>
where F: Fn(&mut [u8]),

Provided Methods§

Source

fn read_variable_bytes<R: Read>(reader: &mut R, length: usize) -> Result<Self>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ReadVariable for String

Source§

fn read_variable_bytes_with_callback<F, R: Read>( reader: &mut R, callback: F, length: usize, ) -> Result<String>
where F: Fn(&mut [u8]),

Source§

impl ReadVariable for Vec<u8>

Source§

fn read_variable_bytes_with_callback<F, R: Read>( reader: &mut R, callback: F, length: usize, ) -> Result<Vec<u8>>
where F: Fn(&mut [u8]),

Implementors§