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

pub trait Plugin<S: Send + Sync + 'static, E: 'static>: Send + Sync {
    fn before_handler(&self, request: &mut Request);
fn after_handler(
        &self,
        future: Box<Future<Item = PluginData<S>, Error = E>>
    ) -> Box<Future<Item = PluginData<S>, Error = E>>; }

A plugable component, run on every request (for which a valid route exists)

Required Methods

This runs before the handler, and potentially modifies the request

This runs after the handler. This must return a future that uses the passed in future, returning the modified future, (e.g. perhaps using and_then) This potentially modifies the Response (available through the data parameter).

Implementations on Foreign Types

impl<'a, S: Send + Sync + 'static, E: 'static, T: Send + Sync + Plugin<S, E>> Plugin<S, E> for &'a T
[src]

[src]

[src]

Implementors