Skip to main content

IntoHandler

Trait IntoHandler 

Source
pub trait IntoHandler<Req, Resp, Params> {
    // Required method
    fn into_handler(self, name: &'static str) -> Box<dyn Handler<Req, Resp>>;
}
Expand description

Converts a compatible function into a boxed Handler.

Implemented for parameterized functions fn(Req, P0, P1, ...) -> Result<Resp, E> where each P is a SystemParam and E: ToString. The error is converted to String at the bridge boundary. Parallel to IntoSystem.

Required Methods§

Source

fn into_handler(self, name: &'static str) -> Box<dyn Handler<Req, Resp>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Func, Req, Resp, P0: SystemParam + 'static, P1: SystemParam + 'static, P2: SystemParam + 'static, P3: SystemParam + 'static, P4: SystemParam + 'static, P5: SystemParam + 'static, P6: SystemParam + 'static, P7: SystemParam + 'static> IntoHandler<Req, Resp, (P0, P1, P2, P3, P4, P5, P6, P7)> for Func
where Func: HandlerParamFunction<Req, Resp, (P0, P1, P2, P3, P4, P5, P6, P7)>, Req: 'static, Resp: 'static,

Source§

impl<Func, Req, Resp, P0: SystemParam + 'static, P1: SystemParam + 'static, P2: SystemParam + 'static, P3: SystemParam + 'static, P4: SystemParam + 'static, P5: SystemParam + 'static, P6: SystemParam + 'static> IntoHandler<Req, Resp, (P0, P1, P2, P3, P4, P5, P6)> for Func
where Func: HandlerParamFunction<Req, Resp, (P0, P1, P2, P3, P4, P5, P6)>, Req: 'static, Resp: 'static,

Source§

impl<Func, Req, Resp, P0: SystemParam + 'static, P1: SystemParam + 'static, P2: SystemParam + 'static, P3: SystemParam + 'static, P4: SystemParam + 'static, P5: SystemParam + 'static> IntoHandler<Req, Resp, (P0, P1, P2, P3, P4, P5)> for Func
where Func: HandlerParamFunction<Req, Resp, (P0, P1, P2, P3, P4, P5)>, Req: 'static, Resp: 'static,

Source§

impl<Func, Req, Resp, P0: SystemParam + 'static, P1: SystemParam + 'static, P2: SystemParam + 'static, P3: SystemParam + 'static, P4: SystemParam + 'static> IntoHandler<Req, Resp, (P0, P1, P2, P3, P4)> for Func
where Func: HandlerParamFunction<Req, Resp, (P0, P1, P2, P3, P4)>, Req: 'static, Resp: 'static,

Source§

impl<Func, Req, Resp, P0: SystemParam + 'static, P1: SystemParam + 'static, P2: SystemParam + 'static, P3: SystemParam + 'static> IntoHandler<Req, Resp, (P0, P1, P2, P3)> for Func
where Func: HandlerParamFunction<Req, Resp, (P0, P1, P2, P3)>, Req: 'static, Resp: 'static,

Source§

impl<Func, Req, Resp, P0: SystemParam + 'static, P1: SystemParam + 'static, P2: SystemParam + 'static> IntoHandler<Req, Resp, (P0, P1, P2)> for Func
where Func: HandlerParamFunction<Req, Resp, (P0, P1, P2)>, Req: 'static, Resp: 'static,

Source§

impl<Func, Req, Resp, P0: SystemParam + 'static, P1: SystemParam + 'static> IntoHandler<Req, Resp, (P0, P1)> for Func
where Func: HandlerParamFunction<Req, Resp, (P0, P1)>, Req: 'static, Resp: 'static,

Source§

impl<Func, Req, Resp, P0: SystemParam + 'static> IntoHandler<Req, Resp, (P0,)> for Func
where Func: HandlerParamFunction<Req, Resp, (P0,)>, Req: 'static, Resp: 'static,

Source§

impl<Func, Req, Resp> IntoHandler<Req, Resp, ()> for Func
where Func: HandlerParamFunction<Req, Resp, ()>, Req: 'static, Resp: 'static,