Trait pemmican::plugins::Plugin[][src]

pub trait Plugin<S, E> {
    fn handle(
        data: PluginData<S>
    ) -> Box<Future<Item = PluginData<S>, Error = E>>; }

A plugin provides a handler for a request.

Code within these handlers should take care not to block or call functions which may block. Instead, it should return futures immediately, or None.

In the case of an error, if at all possible, respond to the client with a 5xx error code and return a Response rather than returning an Error through the future. However, either way works.

Required Methods

Important traits for Box<R>