Trait jdn_cli::CliHandler[][src]

pub trait CliHandler {
    fn get_commands(&self) -> HashSet<&'static str>;
fn handle_command(
        &self,
        command: &str,
        args: Vec<String>,
        writer: &mut dyn Write
    ) -> Result<(), CliError>; }

The trait that allows commands received from the command line interface to be translated and executed.

Required methods

fn get_commands(&self) -> HashSet<&'static str>[src]

Gets the commands that the handler is able to translate and execute. Returns the commands for which the handler is responsible. Note that the contents of the Set must not change over the lifetime of the handler.

fn handle_command(
    &self,
    command: &str,
    args: Vec<String>,
    writer: &mut dyn Write
) -> Result<(), CliError>
[src]

Parses the given arguments and executes the given command. Standard output generated by executing the command may be sent to the given writer.

Errors

A Result indicating if an error occurred while executing the command, or if the command could not be executed.

Loading content...

Implementors

Loading content...