Write

Trait Write 

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

Generic write trait similar to std::io::Write.

The instances of Write are required to construct Sender that can write MavLink frames.

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

Wrappers are available for specific I/O implementations:

Required Methods§

Source

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

Attempts to write an entire buffer into this writer.

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

§Errors

Returns generic error in case of I/O failure.

Source

fn flush(&mut self) -> Result<(), Err>

Flush this output stream, ensuring that all intermediately buffered contents reach their destination.

Implementors§