#[non_exhaustive]pub struct ClientRateLimit {
pub bytes_per_second: NonZeroU32,
pub max_burst_bytes: Option<NonZeroU32>,
}Available on crate feature
server only.Expand description
Per-client rate limit configuration.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.bytes_per_second: NonZeroU32Max number of bytes per second to read from the client connection.
max_burst_bytes: Option<NonZeroU32>Max number of bytes to read in a single burst.
Implementations§
Source§impl ClientRateLimit
impl ClientRateLimit
Sourcepub fn new(bytes_per_second: NonZeroU32) -> Self
pub fn new(bytes_per_second: NonZeroU32) -> Self
Creates a new ClientRateLimit with the given byte rate.
max_burst_bytes is left unset; assign it after construction to allow bursting.
Trait Implementations§
Source§impl Clone for ClientRateLimit
impl Clone for ClientRateLimit
Source§fn clone(&self) -> ClientRateLimit
fn clone(&self) -> ClientRateLimit
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 Debug for ClientRateLimit
impl Debug for ClientRateLimit
Source§impl PartialEq for ClientRateLimit
impl PartialEq for ClientRateLimit
impl Copy for ClientRateLimit
impl Eq for ClientRateLimit
impl StructuralPartialEq for ClientRateLimit
Auto Trait Implementations§
impl Freeze for ClientRateLimit
impl RefUnwindSafe for ClientRateLimit
impl Send for ClientRateLimit
impl Sync for ClientRateLimit
impl Unpin for ClientRateLimit
impl UnwindSafe for ClientRateLimit
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more