Read

Trait Read 

Source
pub trait Read<Err: Into<Error>> {
    // Required method
    fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Err>;
}
Expand description

Generic read trait similar to std::io::Read.

The instances of Read are required to construct Receiver that can read MavLink frames.

Instead of relying on a particular definition of read trait, we allow users to use any library with I/O capabilities.

Wrappers are available for specific I/O implementations:

Required Methods§

Source

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Err>

Read the exact number of bytes required to fill buffer.

Mimics the corresponding method from std::io::Read.

§Errors

Returns generic error in case of I/O failure.

Implementors§