Trait MutNonBlockingTx

Source
pub trait MutNonBlockingTx {
    type Error;

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

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

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

Required Associated Types§

Source

type Error

The error type returned if function fails.

Required Methods§

Source

fn putc_try(&mut self, ch: u8) -> Result<Option<u8>, Self::Error>

Try and write a single octet to the port’s transmitter. Will return Ok(None) if the FIFO/buffer was full and the octet couldn’t be stored or Ok(Some(ch)) if it was stored OK.

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

Provided Methods§

Source

fn puts_try<I>(&mut self, data: &I) -> Result<usize, (usize, Self::Error)>
where I: AsRef<[u8]> + ?Sized,

Write as much of a complete string to the UART as possible. Returns the number of octets sent, plus the result from the last putc call. Aborts early if putc fails in any way.

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§