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§
Required Methods§
Sourcefn putc_try(&mut self, ch: u8) -> Result<Option<u8>, Self::Error>
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§
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.