pub struct ServeHygieneConfig {
pub drain_timeout: Duration,
pub request_timeout: Option<Duration>,
pub max_concurrent_requests: Option<usize>,
pub max_connections: Option<usize>,
pub max_body_bytes: Option<usize>,
}Expand description
Bounds and hygiene knobs for one serve site. The Default is a
conservative, fail-closed posture: a request that exceeds a bound is denied,
never queued.
Fields§
§drain_timeout: DurationHow long the drain waits for in-flight requests after the listener stops
accepting. See DEFAULT_DRAIN_TIMEOUT.
request_timeout: Option<Duration>Per-request processing timeout. None disables it.
max_concurrent_requests: Option<usize>Maximum concurrent in-flight requests. Surplus load sheds with 503
instead of queuing. None disables the limit.
max_connections: Option<usize>Maximum simultaneously accepted TCP connections, enforced by
MaxConnListener. None disables the cap.
max_body_bytes: Option<usize>Global request body-size cap. None preserves each route’s own limit,
which matters for sites that set a large upload limit on one route that a
global cap would clobber. A site with no route-local limit sets this
explicitly.
Trait Implementations§
Source§impl Clone for ServeHygieneConfig
impl Clone for ServeHygieneConfig
Source§fn clone(&self) -> ServeHygieneConfig
fn clone(&self) -> ServeHygieneConfig
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 ServeHygieneConfig
impl Debug for ServeHygieneConfig
Auto Trait Implementations§
impl Freeze for ServeHygieneConfig
impl RefUnwindSafe for ServeHygieneConfig
impl Send for ServeHygieneConfig
impl Sync for ServeHygieneConfig
impl Unpin for ServeHygieneConfig
impl UnsafeUnpin for ServeHygieneConfig
impl UnwindSafe for ServeHygieneConfig
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