pub struct Command0<'a> {
pub docs: DocInfo,
pub subcommands: Vec<Box<dyn Cmd + 'a>>,
pub handler: Option<Box<dyn FnMut() -> CliResult<()> + 'a>>,
}
Fields§
§docs: DocInfo
§subcommands: Vec<Box<dyn Cmd + 'a>>
§handler: Option<Box<dyn FnMut() -> CliResult<()> + 'a>>
Implementations§
Source§impl<'a> Command0<'a>
impl<'a> Command0<'a>
pub fn name(name: &str) -> Self
pub fn with_completions(self) -> Self
pub fn version(self, version: &str) -> Self
pub fn description(self, description: &str) -> Self
pub fn input<T1: Input>(self, in1: T1) -> Command1<'a, T1>
pub fn handler<F>(self, handler: F) -> Self
pub fn subcommand<C: Cmd + 'a>(self, sub: C) -> Self
Trait Implementations§
Source§impl<'a> ParserInfo for Command0<'a>
impl<'a> ParserInfo for Command0<'a>
fn docs(&self) -> &DocInfo
fn symbols(&mut self) -> Vec<&mut dyn Input>
fn subcommand_docs(&self) -> Vec<DocInfo>
fn call_handler(&mut self) -> CliResult<()>
fn push_parent(&mut self, parents: &[String])
fn complete_subcommand( &mut self, sub_idx: usize, tokens: &[String], ) -> Result<Vec<CompOut>, CliError>
fn parse_subcommand( &mut self, sub_idx: usize, tokens: &[String], ) -> Result<(), CliError>
Auto Trait Implementations§
impl<'a> Freeze for Command0<'a>
impl<'a> !RefUnwindSafe for Command0<'a>
impl<'a> !Send for Command0<'a>
impl<'a> !Sync for Command0<'a>
impl<'a> Unpin for Command0<'a>
impl<'a> !UnwindSafe for Command0<'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