pub struct KeepAliveService<F, E>where
F: Fn() -> E,{ /* private fields */ }Expand description
A service that fails readiness once it has been idle too long.
See KeepAlive for details.
Implementations§
Source§impl<F, E> KeepAliveService<F, E>where
F: Fn() -> E,
impl<F, E> KeepAliveService<F, E>where
F: Fn() -> E,
Sourcepub fn new(dur: Millis, f: F) -> KeepAliveService<F, E>
pub fn new(dur: Millis, f: F) -> KeepAliveService<F, E>
Creates a keep-alive service with the maximum idle time dur.
f creates the error returned once the service has been idle longer
than dur.
Trait Implementations§
Source§impl<F, E> Debug for KeepAliveService<F, E>where
F: Fn() -> E,
impl<F, E> Debug for KeepAliveService<F, E>where
F: Fn() -> E,
Source§impl<F, E, St, Req> Service<St, Req> for KeepAliveService<F, E>where
F: Fn() -> E,
impl<F, E, St, Req> Service<St, Req> for KeepAliveService<F, E>where
F: Fn() -> E,
Source§async fn ready(
&self,
ctx: Ctx<'_, KeepAliveService<F, E>, St>,
) -> Result<(), <KeepAliveService<F, E> as Service<St, Req>>::Error>
async fn ready( &self, ctx: Ctx<'_, KeepAliveService<F, E>, St>, ) -> Result<(), <KeepAliveService<F, E> as Service<St, Req>>::Error>
Waits until the service is ready to process a request. Read more
Source§async fn call(
&self,
req: Req,
_: Ctx<'_, KeepAliveService<F, E>, St>,
) -> Result<Req, E>
async fn call( &self, req: Req, _: Ctx<'_, KeepAliveService<F, E>, St>, ) -> Result<Req, E>
Processes a request and asynchronously returns the response. Read more
Source§fn map<F, Res>(self, f: F) -> ServiceChain<Map<F, Self, Res>, St, Req>
fn map<F, Res>(self, f: F) -> ServiceChain<Map<F, Self, Res>, St, Req>
Maps this service’s output to a different type, returning a new service. Read more
Source§fn map_err<F, E>(self, f: F) -> ServiceChain<MapErr<F, Self, E>, St, Req>
fn map_err<F, E>(self, f: F) -> ServiceChain<MapErr<F, Self, E>, St, Req>
Maps this service’s error to a different type, returning a new service. Read more
Auto Trait Implementations§
impl<F, E> !Freeze for KeepAliveService<F, E>
impl<F, E> !RefUnwindSafe for KeepAliveService<F, E>
impl<F, E> !Sync for KeepAliveService<F, E>
impl<F, E> Send for KeepAliveService<F, E>where
F: Send,
impl<F, E> Unpin for KeepAliveService<F, E>where
F: Unpin,
impl<F, E> UnsafeUnpin for KeepAliveService<F, E>where
F: UnsafeUnpin,
impl<F, E> UnwindSafe for KeepAliveService<F, E>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S, St, Req> IntoService<S, St, Req> for Swhere
S: Service<St, Req>,
impl<S, St, Req> IntoService<S, St, Req> for Swhere
S: Service<St, Req>,
Source§fn into_service(self) -> S
fn into_service(self) -> S
Converts this value into a service.