Struct LightCliInput

Source
pub struct LightCliInput<SLEN>
where SLEN: ArrayLength<u8>,
{ /* private fields */ }

Implementations§

Source§

impl<SLEN: ArrayLength<u8>> LightCliInput<SLEN>

Source

pub fn new() -> Self

Create a new LightCLI instance.

Source

pub fn parse_data<CB>(&mut self, callback: CB) -> Result<(), Error>
where CB: FnMut(CallbackCommand<'_>),

Try to parse as much data from the internal ring buffer as possible.

§Arguments
  • callback - This is the callback that will receive all parsing events.
§Remarks

All commands are in the form “COMMAND KEY=VALUE”. For every parsed key/value pair the callback will be triggered with the current command string, current key and the corresponding value. When a newline is read the callback is triggered with a command event.

Source

pub fn fill<E>(&mut self, ser: &mut dyn Read<u8, Error = E>) -> Result<(), E>

Copy as many available bytes from ser into the buffer as possible.

§Arguments
  • ser - The serial interface to read from.
§Remarks

This will continue to try to read a byte from the serial device until the device returns nb::Error::WouldBlock.

Auto Trait Implementations§

§

impl<SLEN> !Freeze for LightCliInput<SLEN>

§

impl<SLEN> !RefUnwindSafe for LightCliInput<SLEN>

§

impl<SLEN> Send for LightCliInput<SLEN>

§

impl<SLEN> !Sync for LightCliInput<SLEN>

§

impl<SLEN> Unpin for LightCliInput<SLEN>
where <SLEN as ArrayLength<u8>>::ArrayType: Unpin,

§

impl<SLEN> UnwindSafe for LightCliInput<SLEN>
where <SLEN as ArrayLength<u8>>::ArrayType: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.