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

Object Safety§

This trait is not object safe.

Implementors§

source§

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