Struct ntex_service::dev::FnServiceFactory [−][src]
pub struct FnServiceFactory<F, Fut, Req, Res, Err, Cfg, FShut = fn()> where
F: Fn(Req) -> Fut,
Fut: Future<Output = Result<Res, Err>>, { /* fields omitted */ }
Implementations
pub fn on_shutdown<FShut>(
self,
f: FShut
) -> FnServiceFactory<F, Fut, Req, Res, Err, Cfg, FShut> where
FShut: FnOnce(),
pub fn on_shutdown<FShut>(
self,
f: FShut
) -> FnServiceFactory<F, Fut, Req, Res, Err, Cfg, FShut> where
FShut: FnOnce(),
Set function that get called oin poll_shutdown method of Service trait.
Trait Implementations
impl<F, Fut, Req, Res, Err, Cfg> IntoServiceFactory<FnServiceFactory<F, Fut, Req, Res, Err, Cfg, fn()>> for F where
F: Fn(Req) -> Fut + Clone,
Fut: Future<Output = Result<Res, Err>>,
impl<F, Fut, Req, Res, Err, Cfg> IntoServiceFactory<FnServiceFactory<F, Fut, Req, Res, Err, Cfg, fn()>> for F where
F: Fn(Req) -> Fut + Clone,
Fut: Future<Output = Result<Res, Err>>,
Convert Self
to a ServiceFactory
type Request = Req
type Request = Req
Requests handled by the service.
type Response = Res
type Response = Res
Responses given by the service.
type Error = Err
type Error = Err
Errors produced by the service.
type Future = Fut
type Future = Fut
The future response value.
Returns Ready
when the service is able to process requests. Read more
Process the request and return the response asynchronously. Read more
Map this service’s output to a different type, returning a new service of the resulting type. Read more
impl<F, Fut, Req, Res, Err, Cfg, FShut> ServiceFactory for FnServiceFactory<F, Fut, Req, Res, Err, Cfg, FShut> where
F: Fn(Req) -> Fut + Clone,
FShut: FnOnce() + Clone,
Fut: Future<Output = Result<Res, Err>>,
impl<F, Fut, Req, Res, Err, Cfg, FShut> ServiceFactory for FnServiceFactory<F, Fut, Req, Res, Err, Cfg, FShut> where
F: Fn(Req) -> Fut + Clone,
FShut: FnOnce() + Clone,
Fut: Future<Output = Result<Res, Err>>,
type Request = Req
type Request = Req
Requests handled by the service.
type Response = Res
type Response = Res
Responses given by the service
type Error = Err
type Error = Err
Errors produced by the service
type Config = Cfg
type Config = Cfg
Service factory configuration
Create and return a new service value asynchronously.
Map this service’s output to a different type, returning a new service of the resulting type. Read more
Map this service’s error to a different error, returning a new service.
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
Self: Sized,
F: Fn(Self::InitError) -> E + Clone,
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
Self: Sized,
F: Fn(Self::InitError) -> E + Clone,
Map this factory’s init error to a different error, returning a new service.
Auto Trait Implementations
impl<F, Fut, Req, Res, Err, Cfg, FShut = fn()> !RefUnwindSafe for FnServiceFactory<F, Fut, Req, Res, Err, Cfg, FShut>
impl<F, Fut, Req, Res, Err, Cfg, FShut> Send for FnServiceFactory<F, Fut, Req, Res, Err, Cfg, FShut> where
Cfg: Send,
F: Send,
FShut: Send,
Req: Send,
impl<F, Fut, Req, Res, Err, Cfg, FShut = fn()> !Sync for FnServiceFactory<F, Fut, Req, Res, Err, Cfg, FShut>
impl<F, Fut, Req, Res, Err, Cfg, FShut> Unpin for FnServiceFactory<F, Fut, Req, Res, Err, Cfg, FShut> where
Cfg: Unpin,
F: Unpin,
FShut: Unpin,
Req: Unpin,
impl<F, Fut, Req, Res, Err, Cfg, FShut> UnwindSafe for FnServiceFactory<F, Fut, Req, Res, Err, Cfg, FShut> where
Cfg: UnwindSafe,
F: UnwindSafe,
FShut: UnwindSafe,
Req: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert to a Service
Convert Self
to a ServiceFactory