pub struct Commander<'a, S: ?Sized, T: ?Sized> { /* private fields */ }
Expand description
Define a group of subcommands to be run directly, or converted as a whole into a higher-order command
Implementations§
Source§impl<'a, S: ?Sized, T: ?Sized> Commander<'a, S, T>
impl<'a, S: ?Sized, T: ?Sized> Commander<'a, S, T>
pub fn options( self, opts: impl for<'x, 'y> Fn(App<'x, 'y>) -> App<'x, 'y> + 'a, ) -> Self
pub fn args<U: ?Sized>( self, args: impl for<'x> Fn(&'x S, &'x ArgMatches<'_>) -> &'x U + 'a, ) -> Commander<'a, S, U>
pub fn add_cmd(self, cmd: impl CommandLike<T> + 'a) -> Self
pub fn no_cmd( self, no_cmd: impl Fn(&T, &ArgMatches<'_>) -> Result<(), Error> + 'a, ) -> Self
pub fn into_cmd(self, name: &'a str) -> MultiCommand<'a, S, T>
Source§impl<'a, T: ?Sized> Commander<'a, (), T>
impl<'a, T: ?Sized> Commander<'a, (), T>
pub fn run(&self)
pub fn run_with_args( &self, args: impl IntoIterator<Item = impl Into<OsString> + Clone>, )
pub fn run_result(&self) -> Result<(), Error>
pub fn run_with_args_result( &self, args: impl IntoIterator<Item = impl Into<OsString> + Clone>, ) -> Result<(), Error>
Auto Trait Implementations§
impl<'a, S, T> Freeze for Commander<'a, S, T>
impl<'a, S, T> !RefUnwindSafe for Commander<'a, S, T>
impl<'a, S, T> !Send for Commander<'a, S, T>
impl<'a, S, T> !Sync for Commander<'a, S, T>
impl<'a, S, T> Unpin for Commander<'a, S, T>
impl<'a, S, T> !UnwindSafe for Commander<'a, S, T>
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