pub struct Io<'a> { /* private fields */ }Expand description
Output handle passed to command handlers.
Wraps the shell’s writer. The concrete transport type is hidden, so a command works unchanged over UART, USB CDC, etc.
Io also implements embedded_io_async::Write, so commands can pass
it to any code expecting that trait (error type Error).
Implementations§
Source§impl<'a> Io<'a>
impl<'a> Io<'a>
Sourcepub async fn print(&mut self, s: &str) -> Result<()>
pub async fn print(&mut self, s: &str) -> Result<()>
Write a string slice, flushing so that it reaches the terminal.
Sourcepub async fn println(&mut self, s: &str) -> Result<()>
pub async fn println(&mut self, s: &str) -> Result<()>
Write a string slice followed by \r\n, flushing the transport.
Trait Implementations§
Source§impl Write for Io<'_>
impl Write for Io<'_>
Source§async fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
async fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Write a buffer into this writer, returning how many bytes were written. Read more
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Io<'a>
impl<'a> !Send for Io<'a>
impl<'a> !Sync for Io<'a>
impl<'a> !UnwindSafe for Io<'a>
impl<'a> Freeze for Io<'a>
impl<'a> Unpin for Io<'a>
impl<'a> UnsafeUnpin for Io<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more