[][src]Struct light_cli::LightCliOutput

pub struct LightCliOutput<'a, E: 'a> { /* fields omitted */ }

Methods

impl<'a, E> LightCliOutput<'a, E>[src]

pub fn new(writer: &'a mut dyn Write<u8, Error = E>) -> Self[src]

Creates a now buffered console output instance.

Arguments

  • writer: The serial output instance, implementing the Write<u8> interface.

pub fn flush(&mut self) -> Result<(), E>[src]

Tries to send as many characters as it can until the interface starts blocking or there are no charactors to submit.

Remarks

If the function returns Ok, then the buffer has succesfully been flushed whereas the error WouldBlock indicates that it is not empty but would have blocked if it tried to submit the character.

To completely empty the buffer, use block!(cl_output.flush()).unwrap().

Trait Implementations

impl<'a, E> Write for LightCliOutput<'a, E>[src]

fn write_char(&mut self, c: char) -> Result<(), Error>
1.1.0
[src]

Writes a [char] into this writer, returning whether the write succeeded. Read more

fn write_fmt(&mut self, args: Arguments) -> Result<(), Error>
1.0.0
[src]

Glue for usage of the [write!] macro with implementors of this trait. Read more

Auto Trait Implementations

impl<'a, E> !Send for LightCliOutput<'a, E>

impl<'a, E> !Sync for LightCliOutput<'a, E>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T[src]

type Output = T

Should always be Self