Struct ntex::service::dev::FnService [−][src]
pub struct FnService<F, Fut, Req, Res, Err, FShut = fn()> where
F: Fn(Req) -> Fut,
Fut: Future<Output = Result<Res, Err>>, { /* fields omitted */ }
Implementations
pub fn on_shutdown<FShut>(
self,
f: FShut
) -> FnService<F, Fut, Req, Res, Err, FShut> where
FShut: FnOnce(),
pub fn on_shutdown<FShut>(
self,
f: FShut
) -> FnService<F, Fut, Req, Res, Err, FShut> where
FShut: FnOnce(),
Set function that get called oin poll_shutdown method of Service trait.
Trait Implementations
Convert to a 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
Auto Trait Implementations
impl<F, Fut, Req, Res, Err, FShut = fn()> !RefUnwindSafe for FnService<F, Fut, Req, Res, Err, FShut>
impl<F, Fut, Req, Res, Err, FShut> Send for FnService<F, Fut, Req, Res, Err, FShut> where
F: Send,
FShut: Send,
Req: Send,
impl<F, Fut, Req, Res, Err, FShut> Unpin for FnService<F, Fut, Req, Res, Err, FShut> where
F: Unpin,
FShut: Unpin,
Req: Unpin,
impl<F, Fut, Req, Res, Err, FShut> UnwindSafe for FnService<F, Fut, Req, Res, Err, FShut> where
F: UnwindSafe,
FShut: UnwindSafe,
Req: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert to a Service
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more