pub struct Shell<C, R, A: Parser + Command<C, R>> { /* private fields */ }Expand description
A command that spawns a shell of the provided dispatcher type.
The shell command spawns a shell using rustyline and shellwords libraries. The type arguments it takes are straightforward:
- Context type (state)
- Return type (same as command hierarchy)
- Dispatcher to create a shell for (can be self-referential)
This object is only built if you set the shell feature while importing:
clishe = { version = "^0", features = ["shell"] }§Example
ⓘ
dispatchers! {
Food(self, _: &mut u64) -> Result<()> [
Shell: clishe::Shell<u64, (), Food>,
],
}Trait Implementations§
Source§impl<C, R, A> CommandFactory for Shell<C, R, A>
impl<C, R, A> CommandFactory for Shell<C, R, A>
Source§fn into_app_for_update<'b>() -> App<'b>
fn into_app_for_update<'b>() -> App<'b>
Deprecated, replaced with
CommandFactory::command_for_updateSource§impl<C, R, A> FromArgMatches for Shell<C, R, A>
impl<C, R, A> FromArgMatches for Shell<C, R, A>
Source§fn from_arg_matches(_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(_matches: &ArgMatches) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, _matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn from_arg_matches_mut(matches: &mut ArgMatches) -> Result<Self, Error>
fn from_arg_matches_mut(matches: &mut ArgMatches) -> Result<Self, Error>
Source§fn update_from_arg_matches_mut(
&mut self,
matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§impl<C, R, A> Parser for Shell<C, R, A>
impl<C, R, A> Parser for Shell<C, R, A>
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, exit on error
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Update from iterator, exit on error
Auto Trait Implementations§
impl<C, R, A> Freeze for Shell<C, R, A>
impl<C, R, A> RefUnwindSafe for Shell<C, R, A>
impl<C, R, A> Send for Shell<C, R, A>
impl<C, R, A> Sync for Shell<C, R, A>
impl<C, R, A> Unpin for Shell<C, R, A>
impl<C, R, A> UnwindSafe for Shell<C, R, 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