Trait embedded_serial::ImmutBlockingTx
[−]
[src]
pub trait ImmutBlockingTx { type Error; fn putc(&self, ch: u8) -> Result<(), Self::Error>; fn puts<I: ?Sized>(&self, data: &I) -> Result<(), (usize, Self::Error)>
where
I: AsRef<[u8]>, { ... } }
Implementors of this trait offer octet based serial data transmission using a blocking API and only requiring an immutable reference to self.
Associated Types
type Error
The error type returned if a function fails.
Required Methods
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
fn puts<I: ?Sized>(&self, data: &I) -> Result<(), (usize, Self::Error)> where
I: AsRef<[u8]>,
I: AsRef<[u8]>,
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.