pub struct TimeoutService<S> { /* private fields */ }Expand description
Applies a timeout to requests.
Implementations§
Source§impl<S> TimeoutService<S>where
S: Service,
impl<S> TimeoutService<S>where
S: Service,
pub fn new<U>(timeout: Duration, service: U) -> Selfwhere
U: IntoService<S>,
Trait Implementations§
Source§impl<S: Clone> Clone for TimeoutService<S>
impl<S: Clone> Clone for TimeoutService<S>
Source§fn clone(&self) -> TimeoutService<S>
fn clone(&self) -> TimeoutService<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S: Debug> Debug for TimeoutService<S>
impl<S: Debug> Debug for TimeoutService<S>
Source§impl<S> Service for TimeoutService<S>where
S: Service,
impl<S> Service for TimeoutService<S>where
S: Service,
Source§type Future = TimeoutServiceResponse<S>
type Future = TimeoutServiceResponse<S>
The future response value.
Source§fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns
Ready when the service is able to process requests. Read moreSource§fn call(&mut self, request: S::Request) -> Self::Future
fn call(&mut self, request: S::Request) -> Self::Future
Process the request and return the response asynchronously. Read more
Auto Trait Implementations§
impl<S> Freeze for TimeoutService<S>where
S: Freeze,
impl<S> RefUnwindSafe for TimeoutService<S>where
S: RefUnwindSafe,
impl<S> Send for TimeoutService<S>where
S: Send,
impl<S> Sync for TimeoutService<S>where
S: Sync,
impl<S> Unpin for TimeoutService<S>where
S: Unpin,
impl<S> UnwindSafe for TimeoutService<S>where
S: 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoService<T> for Twhere
T: Service,
impl<T> IntoService<T> for Twhere
T: Service,
Source§fn into_service(self) -> T
fn into_service(self) -> T
Convert to a
Service