pub struct GuardConfig {
pub max_requests: Option<u64>,
pub max_bytes: Option<u64>,
pub max_connections: Option<u32>,
pub work_ms: Option<u64>,
pub sweep: Duration,
pub whitelist: Vec<Net>,
pub trusted_proxies: Vec<Net>,
}Expand description
Limits; None means no limit of that kind.
Fields§
§max_requests: Option<u64>Weighted requests per client per sweep.
max_bytes: Option<u64>Response bytes per client per sweep.
max_connections: Option<u32>Connections per client open at once.
work_ms: Option<u64>Milliseconds of handling that count as one more request against
max_requests, so that a request that reads much cold history costs
more than one that is answered from the cache.
sweep: Duration§whitelist: Vec<Net>Addresses and networks that are never limited.
trusted_proxies: Vec<Net>Peers whose forwarding headers name the real client.
Implementations§
Trait Implementations§
Source§impl Clone for GuardConfig
impl Clone for GuardConfig
Source§fn clone(&self) -> GuardConfig
fn clone(&self) -> GuardConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 GuardConfig
impl Debug for GuardConfig
Source§impl Default for GuardConfig
impl Default for GuardConfig
Source§fn default() -> GuardConfig
fn default() -> GuardConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GuardConfig
impl RefUnwindSafe for GuardConfig
impl Send for GuardConfig
impl Sync for GuardConfig
impl Unpin for GuardConfig
impl UnsafeUnpin for GuardConfig
impl UnwindSafe for GuardConfig
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].