Trait rama::http::service::web::EndpointServiceFn

pub trait EndpointServiceFn<S, T>: Sealed<S, T> + Clone + Send + Sync + 'static {
    // Required method
    fn call(
        &self,
        ctx: Context<S>,
        req: Request<Body>,
    ) -> impl Future<Output = Response<Body>> + Send;
}
Expand description

rama_core::Service implemented for functions taking extractors.

Required Methods§

fn call( &self, ctx: Context<S>, req: Request<Body>, ) -> impl Future<Output = Response<Body>> + Send

Serve a response for the given request.

It is expected to do so by extracting the desired data from the context and/or request, and then calling the function with the extracted data.

Object Safety§

This trait is not object safe.

Implementors§

§

impl<F, R, O, S> EndpointServiceFn<S, (F, R, O)> for F
where F: Fn() -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static,

§

impl<F, R, O, S, I, M> EndpointServiceFn<S, (F, R, O, I, M)> for F
where F: Fn(I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, I: FromRequest<S, M>, M: Send + Sync + 'static,

§

impl<F, R, O, S, T1> EndpointServiceFn<S, (F, R, O, (), (), (), (), (), (), (), (), (), (), (), (), T1, Context<S>, Request<Body>)> for F
where F: Fn(T1, Context<S>, Request<Body>) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>,

§

impl<F, R, O, S, T1, I, M> EndpointServiceFn<S, (F, R, O, T1, I, M)> for F
where F: Fn(T1, I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, I: FromRequest<S, M>, M: Send + Sync + 'static,

§

impl<F, R, O, S, T1, T2> EndpointServiceFn<S, (F, R, O, (), (), (), (), (), (), (), (), (), (), (), (), T1, T2, Context<S>, Request<Body>)> for F
where F: Fn(T1, T2, Context<S>, Request<Body>) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>,

§

impl<F, R, O, S, T1, T2, I, M> EndpointServiceFn<S, (F, R, O, T1, T2, I, M)> for F
where F: Fn(T1, T2, I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, I: FromRequest<S, M>, M: Send + Sync + 'static,

§

impl<F, R, O, S, T1, T2, T3> EndpointServiceFn<S, (F, R, O, (), (), (), (), (), (), (), (), (), (), (), (), T1, T2, T3, Context<S>, Request<Body>)> for F
where F: Fn(T1, T2, T3, Context<S>, Request<Body>) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>,

§

impl<F, R, O, S, T1, T2, T3, I, M> EndpointServiceFn<S, (F, R, O, T1, T2, T3, I, M)> for F
where F: Fn(T1, T2, T3, I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, I: FromRequest<S, M>, M: Send + Sync + 'static,

§

impl<F, R, O, S, T1, T2, T3, T4> EndpointServiceFn<S, (F, R, O, (), (), (), (), (), (), (), (), (), (), (), (), T1, T2, T3, T4, Context<S>, Request<Body>)> for F
where F: Fn(T1, T2, T3, T4, Context<S>, Request<Body>) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>,

§

impl<F, R, O, S, T1, T2, T3, T4, I, M> EndpointServiceFn<S, (F, R, O, T1, T2, T3, T4, I, M)> for F
where F: Fn(T1, T2, T3, T4, I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, I: FromRequest<S, M>, M: Send + Sync + 'static,

§

impl<F, R, O, S, T1, T2, T3, T4, T5> EndpointServiceFn<S, (F, R, O, (), (), (), (), (), (), (), (), (), (), (), (), T1, T2, T3, T4, T5, Context<S>, Request<Body>)> for F
where F: Fn(T1, T2, T3, T4, T5, Context<S>, Request<Body>) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, I, M> EndpointServiceFn<S, (F, R, O, T1, T2, T3, T4, T5, I, M)> for F
where F: Fn(T1, T2, T3, T4, T5, I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, I: FromRequest<S, M>, M: Send + Sync + 'static,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6> EndpointServiceFn<S, (F, R, O, (), (), (), (), (), (), (), (), (), (), (), (), T1, T2, T3, T4, T5, T6, Context<S>, Request<Body>)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, Context<S>, Request<Body>) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, I, M> EndpointServiceFn<S, (F, R, O, T1, T2, T3, T4, T5, T6, I, M)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, I: FromRequest<S, M>, M: Send + Sync + 'static,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, T7> EndpointServiceFn<S, (F, R, O, (), (), (), (), (), (), (), (), (), (), (), (), T1, T2, T3, T4, T5, T6, T7, Context<S>, Request<Body>)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, Context<S>, Request<Body>) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, T7: FromRequestParts<S>,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, T7, I, M> EndpointServiceFn<S, (F, R, O, T1, T2, T3, T4, T5, T6, T7, I, M)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, T7: FromRequestParts<S>, I: FromRequest<S, M>, M: Send + Sync + 'static,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, T7, T8> EndpointServiceFn<S, (F, R, O, (), (), (), (), (), (), (), (), (), (), (), (), T1, T2, T3, T4, T5, T6, T7, T8, Context<S>, Request<Body>)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, Context<S>, Request<Body>) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, T7: FromRequestParts<S>, T8: FromRequestParts<S>,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, T7, T8, I, M> EndpointServiceFn<S, (F, R, O, T1, T2, T3, T4, T5, T6, T7, T8, I, M)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, T7: FromRequestParts<S>, T8: FromRequestParts<S>, I: FromRequest<S, M>, M: Send + Sync + 'static,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, T7, T8, T9> EndpointServiceFn<S, (F, R, O, (), (), (), (), (), (), (), (), (), (), (), (), T1, T2, T3, T4, T5, T6, T7, T8, T9, Context<S>, Request<Body>)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, Context<S>, Request<Body>) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, T7: FromRequestParts<S>, T8: FromRequestParts<S>, T9: FromRequestParts<S>,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, I, M> EndpointServiceFn<S, (F, R, O, T1, T2, T3, T4, T5, T6, T7, T8, T9, I, M)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, T7: FromRequestParts<S>, T8: FromRequestParts<S>, T9: FromRequestParts<S>, I: FromRequest<S, M>, M: Send + Sync + 'static,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> EndpointServiceFn<S, (F, R, O, (), (), (), (), (), (), (), (), (), (), (), (), T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Context<S>, Request<Body>)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Context<S>, Request<Body>) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, T7: FromRequestParts<S>, T8: FromRequestParts<S>, T9: FromRequestParts<S>, T10: FromRequestParts<S>,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, I, M> EndpointServiceFn<S, (F, R, O, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, I, M)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, T7: FromRequestParts<S>, T8: FromRequestParts<S>, T9: FromRequestParts<S>, T10: FromRequestParts<S>, I: FromRequest<S, M>, M: Send + Sync + 'static,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> EndpointServiceFn<S, (F, R, O, (), (), (), (), (), (), (), (), (), (), (), (), T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Context<S>, Request<Body>)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Context<S>, Request<Body>) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, T7: FromRequestParts<S>, T8: FromRequestParts<S>, T9: FromRequestParts<S>, T10: FromRequestParts<S>, T11: FromRequestParts<S>,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, I, M> EndpointServiceFn<S, (F, R, O, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, I, M)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, T7: FromRequestParts<S>, T8: FromRequestParts<S>, T9: FromRequestParts<S>, T10: FromRequestParts<S>, T11: FromRequestParts<S>, I: FromRequest<S, M>, M: Send + Sync + 'static,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> EndpointServiceFn<S, (F, R, O, (), (), (), (), (), (), (), (), (), (), (), (), T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, Context<S>, Request<Body>)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, Context<S>, Request<Body>) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, T7: FromRequestParts<S>, T8: FromRequestParts<S>, T9: FromRequestParts<S>, T10: FromRequestParts<S>, T11: FromRequestParts<S>, T12: FromRequestParts<S>,

§

impl<F, R, O, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, I, M> EndpointServiceFn<S, (F, R, O, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, I, M)> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, I) -> R + Clone + Send + Sync + 'static, R: Future<Output = O> + Send + 'static, O: IntoResponse + Send + Sync + 'static, S: Send + Sync + 'static, T1: FromRequestParts<S>, T2: FromRequestParts<S>, T3: FromRequestParts<S>, T4: FromRequestParts<S>, T5: FromRequestParts<S>, T6: FromRequestParts<S>, T7: FromRequestParts<S>, T8: FromRequestParts<S>, T9: FromRequestParts<S>, T10: FromRequestParts<S>, T11: FromRequestParts<S>, T12: FromRequestParts<S>, I: FromRequest<S, M>, M: Send + Sync + 'static,