Skip to main content

IntoServiceFn

Trait IntoServiceFn 

Source
pub trait IntoServiceFn<Args> {
    type Handler: Handler;

    // Required method
    fn into_service_fn(self) -> ServiceFn<Self::Handler>;
}
Expand description

Service function creation trait for different handler signatures

Required Associated Types§

Required Methods§

Implementors§

Source§

impl<F, Fut, R> IntoServiceFn<(Request<Incoming>, AppState)> for F
where F: Fn(Request, AppState) -> Fut + Clone + Send + 'static, Fut: Future<Output = R> + Send + 'static, R: IntoFunctionResponse,

Implementation for handlers that take Request and AppState

Source§

impl<F, Fut, R> IntoServiceFn<(Request<Incoming>,)> for F
where F: Fn(Request) -> Fut + Clone + Send + 'static, Fut: Future<Output = R> + Send + 'static, R: IntoFunctionResponse,

Implementation for handlers that only take Request (stateless)