Skip to main content

Handler

Trait Handler 

Source
pub trait Handler<T>:
    Clone
    + Send
    + Sync
    + Sized
    + 'static {
    const BACKGROUND_TASKS: bool = false;

    // Required methods
    fn call(self, req: Request) -> impl Future<Output = Response> + Send;
    fn describe(op: &mut Operation, registry: &mut SchemaRegistry);
}
Expand description

An endpoint callable with a request. T is an inference marker.

Provided Associated Constants§

Source

const BACKGROUND_TASKS: bool = false

Whether this handler needs request-owned background work.

Required Methods§

Source

fn call(self, req: Request) -> impl Future<Output = Response> + Send

Run extraction, the handler body and response conversion.

Source

fn describe(op: &mut Operation, registry: &mut SchemaRegistry)

Document the operation implied by the handler’s signature.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<F, Fut, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12> Handler<(R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)> for F
where F: FnOnce(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse, A1: FromRequestParts, A2: FromRequestParts, A3: FromRequestParts, A4: FromRequestParts, A5: FromRequestParts, A6: FromRequestParts, A7: FromRequestParts, A8: FromRequestParts, A9: FromRequestParts, A10: FromRequestParts, A11: FromRequestParts, A12: FromRequest,

Source§

impl<F, Fut, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11> Handler<(R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> for F
where F: FnOnce(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse, A1: FromRequestParts, A2: FromRequestParts, A3: FromRequestParts, A4: FromRequestParts, A5: FromRequestParts, A6: FromRequestParts, A7: FromRequestParts, A8: FromRequestParts, A9: FromRequestParts, A10: FromRequestParts, A11: FromRequest,

Source§

impl<F, Fut, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> Handler<(R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> for F
where F: FnOnce(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse, A1: FromRequestParts, A2: FromRequestParts, A3: FromRequestParts, A4: FromRequestParts, A5: FromRequestParts, A6: FromRequestParts, A7: FromRequestParts, A8: FromRequestParts, A9: FromRequestParts, A10: FromRequest,

Source§

impl<F, Fut, R, A1, A2, A3, A4, A5, A6, A7, A8, A9> Handler<(R, A1, A2, A3, A4, A5, A6, A7, A8, A9)> for F
where F: FnOnce(A1, A2, A3, A4, A5, A6, A7, A8, A9) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse, A1: FromRequestParts, A2: FromRequestParts, A3: FromRequestParts, A4: FromRequestParts, A5: FromRequestParts, A6: FromRequestParts, A7: FromRequestParts, A8: FromRequestParts, A9: FromRequest,

Source§

impl<F, Fut, R, A1, A2, A3, A4, A5, A6, A7, A8> Handler<(R, A1, A2, A3, A4, A5, A6, A7, A8)> for F
where F: FnOnce(A1, A2, A3, A4, A5, A6, A7, A8) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse, A1: FromRequestParts, A2: FromRequestParts, A3: FromRequestParts, A4: FromRequestParts, A5: FromRequestParts, A6: FromRequestParts, A7: FromRequestParts, A8: FromRequest,

Source§

impl<F, Fut, R, A1, A2, A3, A4, A5, A6, A7> Handler<(R, A1, A2, A3, A4, A5, A6, A7)> for F
where F: FnOnce(A1, A2, A3, A4, A5, A6, A7) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse, A1: FromRequestParts, A2: FromRequestParts, A3: FromRequestParts, A4: FromRequestParts, A5: FromRequestParts, A6: FromRequestParts, A7: FromRequest,

Source§

impl<F, Fut, R, A1, A2, A3, A4, A5, A6> Handler<(R, A1, A2, A3, A4, A5, A6)> for F
where F: FnOnce(A1, A2, A3, A4, A5, A6) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse, A1: FromRequestParts, A2: FromRequestParts, A3: FromRequestParts, A4: FromRequestParts, A5: FromRequestParts, A6: FromRequest,

Source§

impl<F, Fut, R, A1, A2, A3, A4, A5> Handler<(R, A1, A2, A3, A4, A5)> for F
where F: FnOnce(A1, A2, A3, A4, A5) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse, A1: FromRequestParts, A2: FromRequestParts, A3: FromRequestParts, A4: FromRequestParts, A5: FromRequest,

Source§

impl<F, Fut, R, A1, A2, A3, A4> Handler<(R, A1, A2, A3, A4)> for F
where F: FnOnce(A1, A2, A3, A4) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse, A1: FromRequestParts, A2: FromRequestParts, A3: FromRequestParts, A4: FromRequest,

Source§

impl<F, Fut, R, A1, A2, A3> Handler<(R, A1, A2, A3)> for F
where F: FnOnce(A1, A2, A3) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse, A1: FromRequestParts, A2: FromRequestParts, A3: FromRequest,

Source§

impl<F, Fut, R, A1, A2> Handler<(R, A1, A2)> for F
where F: FnOnce(A1, A2) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse, A1: FromRequestParts, A2: FromRequest,

Source§

impl<F, Fut, R, A1> Handler<(R, A1)> for F
where F: FnOnce(A1) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse, A1: FromRequest,

Source§

impl<F, Fut, R> Handler<(R,)> for F
where F: FnOnce() -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = R> + Send, R: IntoResponse,