pub struct TimeoutLayer<A: ?Sized> { /* private fields */ }Expand description
Wraps any owned Application (or a shared Arc<dyn Application>) so
every request through it must complete within duration or the client
gets 504 Gateway Timeout instead of waiting further.
Use this to put one blanket timeout around an entire App/AppWithState/
custom Application. For different timeouts on different routes within
the same app, use with_timeout / with_timeout_state /
with_timeout_async on individual handlers instead.
Implementations§
Source§impl<A: Application + Send + Sync + 'static> TimeoutLayer<A>
impl<A: Application + Send + Sync + 'static> TimeoutLayer<A>
Trait Implementations§
Source§impl<A: Application + Send + Sync + ?Sized + 'static> Application for TimeoutLayer<A>
impl<A: Application + Send + Sync + ?Sized + 'static> Application for TimeoutLayer<A>
Auto Trait Implementations§
impl<A> Freeze for TimeoutLayer<A>where
A: ?Sized,
impl<A> RefUnwindSafe for TimeoutLayer<A>where
A: RefUnwindSafe + ?Sized,
impl<A> Send for TimeoutLayer<A>
impl<A> Sync for TimeoutLayer<A>
impl<A> Unpin for TimeoutLayer<A>where
A: ?Sized,
impl<A> UnsafeUnpin for TimeoutLayer<A>where
A: ?Sized,
impl<A> UnwindSafe for TimeoutLayer<A>where
A: RefUnwindSafe + ?Sized,
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