Struct shi::command::parent::ParentCommand [−][src]
ParentCommand represents a command with subcommands. It has a name, but it does not execute anything itself. It dispatches to the appropriate child command, if one exists.
Implementations
impl<'a, S> ParentCommand<'a, S>
[src]
pub fn new(name: &'a str, sub_cmds: Vec<Command<'a, S>>) -> ParentCommand<'a, S>
[src]
Creates a new ParentCommand.
Arguments
name
- The name of this command.
sub_cmds
- The subcommands or children of the ParentCommand
to be created.
pub fn new_with_help(
name: &'a str,
help: &'a str,
sub_cmds: Vec<Command<'a, S>>
) -> ParentCommand<'a, S>
[src]
name: &'a str,
help: &'a str,
sub_cmds: Vec<Command<'a, S>>
) -> ParentCommand<'a, S>
Creates a new ParentCommand with the given help message.
Arguments
name
- The name of this command.
sub_cmds
- The subcommands or children of the ParentCommand
to be created.
pub fn sub_commands(&self) -> &CommandSet<'_, S>
[src]
Returns a CommandSet
of the child commands under this ParentCommand
.
Trait Implementations
impl<'a, S> BaseCommand for ParentCommand<'a, S>
[src]
type State = S
The State of the command. Expected to be bound to a containing Shell
.
fn name(&self) -> &str
[src]
fn validate_args(&self, args: &[String]) -> Result<()>
[src]
fn execute(&self, state: &mut S, args: &[String]) -> Result<String>
[src]
fn help(&self) -> String
[src]
fn autocomplete(&self, _args: Vec<&str>, _trailing_space: bool) -> Completion
[src]
Auto Trait Implementations
impl<'a, S> !RefUnwindSafe for ParentCommand<'a, S>
impl<'a, S> !Send for ParentCommand<'a, S>
impl<'a, S> !Sync for ParentCommand<'a, S>
impl<'a, S> Unpin for ParentCommand<'a, S>
impl<'a, S> !UnwindSafe for ParentCommand<'a, S>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,