pub struct KeepAlive<R, E, F> { /* private fields */ }Expand description
KeepAlive service factory
Controls min time between requests.
Implementations
Trait Implementations
sourceimpl<R, E, F, C> ServiceFactory<R, C> for KeepAlive<R, E, F> where
F: Fn() -> E + Clone,
impl<R, E, F, C> ServiceFactory<R, C> for KeepAlive<R, E, F> where
F: Fn() -> E + Clone,
type Response = R
type Response = R
Responses given by the service
type Error = E
type Error = E
Errors produced by the service
type InitError = Infallible
type InitError = Infallible
Errors produced while building a service.
type Service = KeepAliveService<R, E, F>
type Service = KeepAliveService<R, E, F>
The Service value created by this factory
sourcefn new_service(&self, _: C) -> Self::Future
fn new_service(&self, _: C) -> Self::Future
Create and return a new service value asynchronously.
sourcefn map<F, Res>(self, f: F) -> MapServiceFactory<Self, F, Req, Res, Cfg> where
F: FnMut(Self::Response) -> Res + Clone,
fn map<F, Res>(self, f: F) -> MapServiceFactory<Self, F, Req, Res, Cfg> where
F: FnMut(Self::Response) -> Res + Clone,
Map this service’s output to a different type, returning a new service of the resulting type. Read more
sourcefn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, Req, Cfg, F, E> where
F: Fn(Self::Error) -> E + Clone,
fn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, Req, Cfg, F, E> where
F: Fn(Self::Error) -> E + Clone,
Map this service’s error to a different error, returning a new service.
sourcefn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, Req, Cfg, F, E> where
F: Fn(Self::InitError) -> E + Clone,
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, Req, Cfg, F, E> where
F: Fn(Self::InitError) -> E + Clone,
Map this factory’s init error to a different error, returning a new service.
Auto Trait Implementations
impl<R, E, F> RefUnwindSafe for KeepAlive<R, E, F> where
E: RefUnwindSafe,
F: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, E, F> Send for KeepAlive<R, E, F> where
E: Send,
F: Send,
R: Send,
impl<R, E, F> Sync for KeepAlive<R, E, F> where
E: Sync,
F: Sync,
R: Sync,
impl<R, E, F> Unpin for KeepAlive<R, E, F> where
E: Unpin,
F: Unpin,
R: Unpin,
impl<R, E, F> UnwindSafe for KeepAlive<R, E, F> where
E: UnwindSafe,
F: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, Req, Cfg> IntoServiceFactory<T, Req, Cfg> for T where
T: ServiceFactory<Req, Cfg>,
impl<T, Req, Cfg> IntoServiceFactory<T, Req, Cfg> for T where
T: ServiceFactory<Req, Cfg>,
sourcepub fn into_factory(self) -> T
pub fn into_factory(self) -> T
Convert Self to a ServiceFactory
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more