Trait Help

Source
pub trait Help {
    // Required methods
    fn command_count() -> usize;
    fn list_commands<W: Write<Error = E>, E: Error>(
        writer: &mut Writer<'_, W, E>,
    ) -> Result<(), E>;
    fn command_help<W: Write<Error = E>, E: Error, F: FnMut(&mut Writer<'_, W, E>) -> Result<(), E>>(
        parent: &mut F,
        command: RawCommand<'_>,
        writer: &mut Writer<'_, W, E>,
    ) -> Result<(), HelpError<E>>;
}

Required Methods§

Source

fn command_count() -> usize

How many commands are known

Source

fn list_commands<W: Write<Error = E>, E: Error>( writer: &mut Writer<'_, W, E>, ) -> Result<(), E>

Print all commands and short description of each

Source

fn command_help<W: Write<Error = E>, E: Error, F: FnMut(&mut Writer<'_, W, E>) -> Result<(), E>>( parent: &mut F, command: RawCommand<'_>, writer: &mut Writer<'_, W, E>, ) -> Result<(), HelpError<E>>

Print help for given command. Command might contain -h or –help options Use given writer to print help text If help request cannot be processed by this object, Err(HelpError::UnknownCommand) must be returned

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a> Help for RawCommand<'a>