pub struct Command<'a, Next, H, T = i32>
where Next: CommandListInternals, H: FnMut(&mut Stdio, Args<'_>) -> T, T: Termination,
{ /* private fields */ }
Available on riot_module_shell only.
Expand description

Internal helper that holds the data assembled using the CommandList::and builder

(Exposed publicly as the CommandList::and trait method can not return an impl CommandList yet)

Trait Implementations§

source§

impl<'a, Next, H, T, const BUFSIZE: usize> CommandList<BUFSIZE> for Command<'a, Next, H, T>
where Next: CommandListInternals, H: FnMut(&mut Stdio, Args<'_>) -> T, T: Termination,

source§

fn with_buffer_size<const NEWSIZE: usize>( self ) -> Self::WithBufferSizeResult<NEWSIZE>

Change the buffer size used for .run_forever_providing_buf(). Read more
§

type WithBufferSizeResult<const NEWSIZE: usize> = Command<'a, Next, H, T>

source§

fn run_once_with_buf(&mut self, linebuffer: &mut [u8])

source§

fn run_once(&mut self, linebuffer: &mut [u8])

👎Deprecated: Use run_once_with_buf, or just run_once_providing_buf, which will take over this name in the next breaking release
source§

fn run_forever_with_buf(&mut self, linebuffer: &mut [u8]) -> !

source§

fn run_forever(&mut self, linebuffer: &mut [u8]) -> !

👎Deprecated: Use run_forever_with_buf, or just run_forever_providing_buf, which will take over this name in the next breaking release
source§

fn run_forever_providing_buf(&mut self) -> !

Run the shell prompt on stdio Read more
source§

fn run_once_providing_buf(&mut self)

Run the shell prompt on stdio until EOF is reached Read more
source§

fn and<'a, H, T>( self, name: &'a CStr, desc: &'a CStr, handler: H ) -> Command<'a, Self, H, T>
where H: FnMut(&mut Stdio, Args<'_>) -> T, T: Termination,

Extend the list of commands by an additional one. Read more
source§

impl<'a, Next, H, T> CommandListInternals for Command<'a, Next, H, T>
where Next: CommandListInternals, H: FnMut(&mut Stdio, Args<'_>) -> T, T: Termination,

§

type Built = BuiltCommand<<Next as CommandListInternals>::Built>

source§

fn build_shell_command<Root: CommandListInternals>(&self) -> Self::Built

source§

fn find_self_and_run( &mut self, argc: i32, argv: *mut *mut c_char, command_index: usize ) -> i32

Run your own callback with argc and argv if the called argument is what the implementation put into its own entry of its Built, or defer to its next.
source§

fn run_any<R, F: Fn(*const shell_command_t, *mut c_char, i32) -> R>( &mut self, linebuffer: &mut [u8], cb: F ) -> R

source§

fn find_root_and_run( argc: i32, argv: *mut *mut c_char, command_index: usize ) -> i32

Auto Trait Implementations§

§

impl<'a, Next, H, T> RefUnwindSafe for Command<'a, Next, H, T>
where H: RefUnwindSafe, Next: RefUnwindSafe,

§

impl<'a, Next, H, T> Send for Command<'a, Next, H, T>
where H: Send, Next: Send,

§

impl<'a, Next, H, T> Sync for Command<'a, Next, H, T>
where H: Sync, Next: Sync,

§

impl<'a, Next, H, T> Unpin for Command<'a, Next, H, T>
where H: Unpin, Next: Unpin,

§

impl<'a, Next, H, T> UnwindSafe for Command<'a, Next, H, T>
where H: UnwindSafe, Next: 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> IntoSwitch for T

source§

fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>

Consumes the IoPin returning a Switch of the appropriate ActiveLevel. Read more
source§

fn into_active_low_switch(self) -> Switch<Self, ActiveLow>
where Self: Sized,

Consumes the IoPin returning a Switch<IoPin, ActiveLow>. Read more
source§

fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>
where Self: Sized,

Consumes the IoPin returning a Switch<IoPin, ActiveHigh>. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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.