Handler

Trait Handler 

Source
pub trait Handler<T>: 'static {
    // Required method
    fn handle(&mut self, env: &Environment) -> T;
}
Expand description

Handler trait that processes an environment and produces a result of type T.

This trait is implemented by handlers that don’t modify themselves during execution.

Required Methods§

Source

fn handle(&mut self, env: &Environment) -> T

Processes the environment and returns a value of type T.

§Arguments
  • env - The environment containing request data and context

Trait Implementations§

Source§

impl<T> Debug for dyn Handler<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementations on Foreign Types§

Source§

impl Handler<()> for ()

Source§

fn handle(&mut self, _env: &Environment)

Implementors§

Source§

impl<H, P, T> Handler<T> for IntoHandler<H, P, T>
where H: HandlerFn<P, T>, P: 'static, T: 'static,

Source§

impl<H, P, T, S> Handler<T> for IntoHandlerWithState<H, P, T, S>
where H: HandlerFnWithState<P, T, S>, S: 'static + Clone, T: 'static, P: 'static,

Source§

impl<T: 'static> Handler<T> for BoxHandler<T>