Function irclap::new_irclap_future [] [src]

pub fn new_irclap_future<'a, CM, CP>(
    handle: Handle,
    cfg: &'a Config,
    app: App<'a, 'a>,
    mapper: CM,
    processor: CP
) -> impl Future<Item = (), Error = IrcError> + 'a where
    CM: IrclapContextMapper + 'a,
    CP: IrclapCommandProcessor + 'a, 

Create a new Future which will execute an irclap application.

You will need the tokio reactor Core to drive the resulting future. You MUST have direct access to the Core. A Handle, while sufficient to create the future, is insufficient to run it. Handle requires a Future bounded with 'static, which this will almost certainly not provide. Future changes will probably make this more embedded in the function signature.

For configuration, note that the irc config must have info needed to identify with the IRC server, along with all the necessary options for connecting in the first place. The future will identify with the server using the nickname and identification setup from your config.

The App has essentially no restrictions, but you should note that the NoBinaryName app setting will be added to the application for commands over IRC.

The mapper handles preprocessing the command to pass it to your clap App for matching, and can be highly customized, but in most cases using an IrclapSimpleContextMapping should probably be sufficient.

The processor is the core part of your application, and is where all the business logic or anything like that should happen.