Trait embedded_serial::MutBlockingTx
[−]
[src]
pub trait MutBlockingTx { type Error; fn putc(&mut self, ch: u8) -> Result<(), Self::Error>; fn puts<I: ?Sized>(&mut 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 requiring a mutable reference to self.
Associated Types
type Error
The error type returned if a function fails.
Required Methods
fn putc(&mut 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>(&mut 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.