pub struct FnCommand<F> { /* private fields */ }Implementations§
Source§impl<F> FnCommand<F>
impl<F> FnCommand<F>
Sourcepub fn with_args(self, choices: &[&[&'static str]]) -> Self
pub fn with_args(self, choices: &[&[&'static str]]) -> Self
One inner slice per position; trailing free-form args may be omitted.
Sourcepub fn with_value_choices(
self,
key: &'static str,
values: &[&'static str],
) -> Self
pub fn with_value_choices( self, key: &'static str, values: &[&'static str], ) -> Self
First Tab completes to key=, subsequent Tabs cycle these values.
pub fn with_long_help(self, long: &'static str) -> Self
Trait Implementations§
Source§impl<Ctx, F> Command<Ctx> for FnCommand<F>
impl<Ctx, F> Command<Ctx> for FnCommand<F>
fn name(&self) -> &str
fn help(&self) -> &str
fn arg_choices(&self, arg_index: usize) -> &[&'static str]
Source§fn arg_value_choices(&self, _arg_index: usize, key: &str) -> &[&'static str]
fn arg_value_choices(&self, _arg_index: usize, key: &str) -> &[&'static str]
key carries no trailing =; empty means free-form.Source§fn run(
&mut self,
args: &[&str],
ctx: &mut Ctx,
out: &mut ConsoleWriter,
) -> Result<()>
fn run( &mut self, args: &[&str], ctx: &mut Ctx, out: &mut ConsoleWriter, ) -> Result<()>
Recoverable issues go to
out.error(..); unrecoverable ones return Err.Source§fn arg_choices_ctx<'a>(
&'a self,
arg_index: usize,
prior: &[&str],
) -> &'a [&'static str]
fn arg_choices_ctx<'a>( &'a self, arg_index: usize, prior: &[&str], ) -> &'a [&'static str]
prior is the arg tokens before the cursor.fn arg_value_choices_ctx<'a>( &'a self, arg_index: usize, key: &str, prior: &[&str], ) -> &'a [&'static str]
Auto Trait Implementations§
impl<F> Freeze for FnCommand<F>where
F: Freeze,
impl<F> RefUnwindSafe for FnCommand<F>where
F: RefUnwindSafe,
impl<F> Send for FnCommand<F>where
F: Send,
impl<F> Sync for FnCommand<F>where
F: Sync,
impl<F> Unpin for FnCommand<F>where
F: Unpin,
impl<F> UnsafeUnpin for FnCommand<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for FnCommand<F>where
F: UnwindSafe,
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