Trait MutBlockingRx

Source
pub trait MutBlockingRx {
    type Error;

    // Required method
    fn getc(&mut self) -> Result<u8, Self::Error>;

    // Provided method
    fn gets<I>(&mut self, buffer: &mut I) -> Result<(), (usize, Self::Error)>
       where I: AsMut<[u8]> + ?Sized { ... }
}
Expand description

Implementors of this trait offer octet based serial data reception using a blocking API and requiring a mutable reference to self.

Required Associated Types§

Source

type Error

The error type returned if a function fails.

Required Methods§

Source

fn getc(&mut self) -> Result<u8, Self::Error>

Read a single octet from the port’s receiver, blocking until the octet can be read from the buffer.

In some implementations, this can result in an Error. If not, use type Error = !.

Provided Methods§

Source

fn gets<I>(&mut self, buffer: &mut I) -> Result<(), (usize, Self::Error)>
where I: AsMut<[u8]> + ?Sized,

Read a specified number of octets into the given buffer, blocking until that many have been read.

In some implementations, this can result in an Error. If not, use type Error = !.

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.

Implementors§