Trait ImmutBlockingTx

Source
pub trait ImmutBlockingTx {
    type Error;

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

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

Implementors of this trait offer octet based serial data transmission using a blocking API and only requiring an immutable reference to self.

Required Associated Types§

Source

type Error

The error type returned if a function fails.

Required Methods§

Source

fn putc(&self, ch: u8) -> Result<(), Self::Error>

Write a single octet to the port’s transmitter, blocking until the octet can be stored in the buffer (not necessarily that the octet has been transmitted).

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

Provided Methods§

Source

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

Write a complete string to the UART. If this returns Ok(()), all the data was sent. Otherwise you get number of octets sent and the 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§