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