pub struct ServerLimits {
pub max_concurrency: Option<usize>,
pub max_consecutive_errors: Option<usize>,
pub request_timeout_ms: Option<u64>,
pub max_connections_per_peer: Option<usize>,
pub max_request_body_bytes: Option<usize>,
pub drain_timeout_secs: Option<u64>,
pub max_total_connections: Option<usize>,
pub load_shed: Option<bool>,
}Expand description
Server-side limits shared between NodeOptions and
the serve path.
Embedding this struct in both NodeOptions and EndpointInner guarantees
that adding a new limit field produces a compile error if only one side is
updated.
Fields§
§max_concurrency: Option<usize>§max_consecutive_errors: Option<usize>§request_timeout_ms: Option<u64>§max_connections_per_peer: Option<usize>§max_request_body_bytes: Option<usize>§drain_timeout_secs: Option<u64>§max_total_connections: Option<usize>§load_shed: Option<bool>When true (the default), reject new requests immediately with 503 Service Unavailable when max_concurrency is already reached rather
than queuing them. Prevents thundering-herd on recovery.
Trait Implementations§
Source§impl Clone for ServerLimits
impl Clone for ServerLimits
Source§fn clone(&self) -> ServerLimits
fn clone(&self) -> ServerLimits
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 ServerLimits
impl Debug for ServerLimits
Source§impl Default for ServerLimits
impl Default for ServerLimits
Source§fn default() -> ServerLimits
fn default() -> ServerLimits
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ServerLimits
impl RefUnwindSafe for ServerLimits
impl Send for ServerLimits
impl Sync for ServerLimits
impl Unpin for ServerLimits
impl UnsafeUnpin for ServerLimits
impl UnwindSafe for ServerLimits
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