Trait irclap::IrclapCommandProcessor [] [src]

pub trait IrclapCommandProcessor {
    fn process_matches<'a, RS>(&self, matches: ArgMatches<'a>, resp: RS)
    where
        RS: IrclapResponseStream + 'a
; }

Used to execute your program based on the results of irclap's message handling and parsing.

An instance of this trait will be called into once parsing is completed for a command. The process_matches function is responsible for performing all actions necessary for handling the command.

Required Methods

Process the results of command parsing, and execute your application.

The implementation of this function will provide essentially all the actual 'business logic' of the program being run via irclap. Anything you need to do that isn't setup, you do in this function.

It's worth noting that there is no way to return an error code from this function. This is partly an artifact of the IRC-first design. For IRC, the only reasonable response to an error is to send a message about it. Do that.

In the future, there may also be a way to provide an exit code for use in CLI contexts, but that does not exist at the moment.

Implementors