pub struct RequestBounds { /* private fields */ }Expand description
The two limits one route is held to.
Cheap to clone. Several values may share one Semaphore — the server
gives /webdav a longer timeout than everything else, but one listener has
one in-flight cap, so both are built over the same permits.
Implementations§
Source§impl RequestBounds
impl RequestBounds
Sourcepub fn new(
timeout: Duration,
client_idle: Duration,
in_flight: Arc<Semaphore>,
) -> Self
pub fn new( timeout: Duration, client_idle: Duration, in_flight: Arc<Semaphore>, ) -> Self
Bounds with this timeout, drawing permits from in_flight.
client_idle is the longest the server waits between two frames of the
request body — NOTEDTHAT_HEADER_READ_TIMEOUT_MS, the same bound hyper
applies to the request head, for the same reason: it measures how long
the client is taking, not how long the server is.
Sourcepub fn with_timeout(&self, timeout: Duration) -> Self
pub fn with_timeout(&self, timeout: Duration) -> Self
The same permits and idle bound, with a different timeout.
Trait Implementations§
Source§impl Clone for RequestBounds
impl Clone for RequestBounds
Auto Trait Implementations§
impl Freeze for RequestBounds
impl RefUnwindSafe for RequestBounds
impl Send for RequestBounds
impl Sync for RequestBounds
impl Unpin for RequestBounds
impl UnsafeUnpin for RequestBounds
impl UnwindSafe for RequestBounds
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request