Struct actix_service::MapInitErr
source · pub struct MapInitErr<A, F, E> { /* private fields */ }
Expand description
MapInitErr
service combinator
Implementations§
source§impl<A, F, E> MapInitErr<A, F, E>
impl<A, F, E> MapInitErr<A, F, E>
sourcepub fn new<Request>(a: A, f: F) -> Selfwhere
A: NewService<Request>,
F: Fn(A::InitError) -> E,
pub fn new<Request>(a: A, f: F) -> Selfwhere
A: NewService<Request>,
F: Fn(A::InitError) -> E,
Create new MapInitErr
combinator
Trait Implementations§
source§impl<A, F, E, Request> NewService<Request> for MapInitErr<A, F, E>where
A: NewService<Request>,
F: Fn(A::InitError) -> E + Clone,
impl<A, F, E, Request> NewService<Request> for MapInitErr<A, F, E>where
A: NewService<Request>,
F: Fn(A::InitError) -> E + Clone,
§type Response = <A as NewService<Request>>::Response
type Response = <A as NewService<Request>>::Response
Responses given by the service
§type Error = <A as NewService<Request>>::Error
type Error = <A as NewService<Request>>::Error
Errors produced by the service
§type Service = <A as NewService<Request>>::Service
type Service = <A as NewService<Request>>::Service
The
Service
value created by this factorysource§fn new_service(&self) -> Self::Future
fn new_service(&self) -> Self::Future
Create and return a new service value asynchronously.
source§fn apply<T, I, F, Out, Req>(
self,
service: I,
f: F
) -> AndThenNewService<Self, ApplyNewService<T, F, Self::Response, Out, Req>>where
Self: Sized,
T: NewService<Req, InitError = Self::InitError, Error = Self::Error>,
I: IntoNewService<T, Req>,
F: Fn(Self::Response, &mut T::Service) -> Out + Clone,
Out: IntoFuture<Error = Self::Error>,
fn apply<T, I, F, Out, Req>(
self,
service: I,
f: F
) -> AndThenNewService<Self, ApplyNewService<T, F, Self::Response, Out, Req>>where
Self: Sized,
T: NewService<Req, InitError = Self::InitError, Error = Self::Error>,
I: IntoNewService<T, Req>,
F: Fn(Self::Response, &mut T::Service) -> Out + Clone,
Out: IntoFuture<Error = Self::Error>,
Apply function to specified service and use it as a next service in
chain. Read more
source§fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B>where
Self: Sized,
F: IntoNewService<B, Self::Response>,
B: NewService<Self::Response, Error = Self::Error, InitError = Self::InitError>,
fn and_then<F, B>(self, new_service: F) -> AndThenNewService<Self, B>where
Self: Sized,
F: IntoNewService<B, Self::Response>,
B: NewService<Self::Response, Error = Self::Error, InitError = Self::InitError>,
Call another service after call to this one has resolved successfully.
source§fn from_err<E>(self) -> FromErrNewService<Self, E>where
Self: Sized,
E: From<Self::Error>,
fn from_err<E>(self) -> FromErrNewService<Self, E>where
Self: Sized,
E: From<Self::Error>,
NewService
that create service to map this service’s error
and new service’s init error to any error
implementing From
for this services
Error`. Read moresource§fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B>where
Self: Sized,
F: IntoNewService<B, Result<Self::Response, Self::Error>>,
B: NewService<Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>,
fn then<F, B>(self, new_service: F) -> ThenNewService<Self, B>where
Self: Sized,
F: IntoNewService<B, Result<Self::Response, Self::Error>>,
B: NewService<Result<Self::Response, Self::Error>, Error = Self::Error, InitError = Self::InitError>,
Create
NewService
to chain on a computation for when a call to the
service finished, passing the result of the call to the next
service B
. Read moresource§fn map<F, R>(self, f: F) -> MapNewService<Self, F, R>where
Self: Sized,
F: Fn(Self::Response) -> R,
fn map<F, R>(self, f: F) -> MapNewService<Self, F, R>where
Self: Sized,
F: Fn(Self::Response) -> R,
Map this service’s output to a different type, returning a new service
of the resulting type. Read more
source§fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E>where
Self: Sized,
F: Fn(Self::Error) -> E,
fn map_err<F, E>(self, f: F) -> MapErrNewService<Self, F, E>where
Self: Sized,
F: Fn(Self::Error) -> E,
Map this service’s error to a different error, returning a new service.
source§fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E>where
Self: Sized,
F: Fn(Self::InitError) -> E,
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E>where
Self: Sized,
F: Fn(Self::InitError) -> E,
Map this service’s init error to a different error, returning a new service.
Auto Trait Implementations§
impl<A, F, E> RefUnwindSafe for MapInitErr<A, F, E>where
A: RefUnwindSafe,
E: RefUnwindSafe,
F: RefUnwindSafe,
impl<A, F, E> Send for MapInitErr<A, F, E>where
A: Send,
E: Send,
F: Send,
impl<A, F, E> Sync for MapInitErr<A, F, E>where
A: Sync,
E: Sync,
F: Sync,
impl<A, F, E> Unpin for MapInitErr<A, F, E>where
A: Unpin,
E: Unpin,
F: Unpin,
impl<A, F, E> UnwindSafe for MapInitErr<A, F, E>where
A: UnwindSafe,
E: UnwindSafe,
F: UnwindSafe,
Blanket Implementations§
source§impl<T, Request> IntoNewService<T, Request> for Twhere
T: NewService<Request>,
impl<T, Request> IntoNewService<T, Request> for Twhere
T: NewService<Request>,
source§fn into_new_service(self) -> T
fn into_new_service(self) -> T
Convert to an
NewService