HandlerOnce

Trait HandlerOnce 

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

Handler trait for single-use handlers that are consumed during execution.

This trait is implemented by handlers that can only be called once because they consume themselves during processing.

Required Methods§

Source

fn handle(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 HandlerOnce<T>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<T: 'static> HandlerOnce<T> for Box<dyn HandlerOnce<T>>

Source§

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

Processes the environment and returns a value of type T. Read more

Implementations on Foreign Types§

Source§

impl HandlerOnce<()> for ()

Source§

fn handle(self, _env: &Environment)

Source§

impl<T: 'static> HandlerOnce<T> for Box<dyn HandlerOnce<T>>

Source§

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

Implementors§

Source§

impl<H, P, T> HandlerOnce<T> for IntoHandlerOnce<H, P, T>
where H: HandlerFnOnce<P, T>, P: 'static, T: 'static,