Struct Timeout
pub struct Timeout<T> { /* private fields */ }
Applies a timeout to requests.
Implementations
impl<T> Timeout<T>
const fn new(inner: T, timeout: Duration) -> SelfCreates a new
Timeoutfn get_ref(&self) -> &TGet a reference to the inner service
fn get_mut(&mut self) -> &mut TGet a mutable reference to the inner service
fn into_inner(self) -> TConsume
self, returning the inner service
Trait Implementations
impl<S, Request> Service<Request> for Timeout<S>
where
S: Service<Request>,
S::Error: Into<BoxError>,
type Response = <S as Service<Request>>::Response;type Error = Box<dyn Error + Sync + Send>;type Future = ResponseFuture<<S as Service<Request>>::Future>;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>fn call(&mut self, request: Request) -> Self::Future
impl<T: Clone> Clone for Timeout<T>
fn clone(&self) -> Timeout<T>
impl<T: Debug> Debug for Timeout<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<T> Freeze for Timeout<T>
where
T: Freeze,
impl<T> RefUnwindSafe for Timeout<T>
where
T: RefUnwindSafe,
impl<T> Send for Timeout<T>
where
T: Send,
impl<T> Sync for Timeout<T>
where
T: Sync,
impl<T> Unpin for Timeout<T>
where
T: Unpin,
impl<T> UnsafeUnpin for Timeout<T>
where
T: UnsafeUnpin,
impl<T> UnwindSafe for Timeout<T>
where
T: UnwindSafe,
Blanket Implementations
impl<C, Target> MakeConnection<Target> for Timeout<T>
where
C: Service<Target>,
<C as Service<Target>>::Response: AsyncRead + AsyncWrite,
type Connection = <C as Service<Target>>::Response;type Error = <C as Service<Target>>::Error;type Future = <C as Service<Target>>::Future;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), <C as MakeConnection<Target>>::Error>>fn make_connection(&mut self, target: Target) -> <C as MakeConnection<Target>>::Future
impl<M, S, Target, Request> MakeService<Target, Request> for Timeout<T>
where
M: Service<Target, Response = S>,
S: Service<Request>,
type Response = <S as Service<Request>>::Response;type Error = <S as Service<Request>>::Error;type Service = S;type MakeError = <M as Service<Target>>::Error;type Future = <M as Service<Target>>::Future;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), <M as MakeService<Target, Request>>::MakeError>>fn make_service(&mut self, target: Target) -> <M as MakeService<Target, Request>>::Future
impl<T> Any for Timeout<T>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Timeout<T>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Timeout<T>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Timeout<T>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Timeout<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for Timeout<T>
impl<T> ToOwned for Timeout<T>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> WithSubscriber for Timeout<T>
impl<T, Request> ServiceExt<Request> for Timeout<T>
where
T: Service<Request> + ?Sized,
impl<T, U> Into<U> for Timeout<T>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Timeout<T>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Timeout<T>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>