pub struct LimitsConfig {
pub max_body_bytes: u64,
pub max_header_bytes: usize,
pub max_uri_bytes: usize,
pub max_connections: usize,
pub pool_wait_ms: u64,
pub header_read_ms: u64,
pub body_read_ms: u64,
pub max_form_parts: usize,
pub max_field_bytes: u64,
pub max_file_bytes: u64,
}Expand description
Request-size and connection limits ([limits] section), enforced in
Rust before a request reaches Lua.
Fields§
§max_body_bytes: u64Maximum declared request body size in bytes (413 beyond it).
max_header_bytes: usizeMaximum request header buffer in bytes (hyper enforces a floor of 8 KiB).
max_uri_bytes: usizeMaximum request URI length in bytes (414 beyond it).
max_connections: usizeMaximum concurrent TCP connections; the listener stops accepting while at the cap.
pool_wait_ms: u64How long a request may wait for a free Lua state before it is shed
with 503 and a Retry-After, in milliseconds. 0 waits forever
(the pre-phase-10 behavior). Shedding happens before any Lua runs,
so an overloaded server answers quickly instead of queueing work
nobody is still waiting for.
header_read_ms: u64How long a client may take to send its complete request headers,
in milliseconds; the connection is closed past it. 0 disables
the deadline.
body_read_ms: u64How long each read of the request body may wait for the next
bytes, in milliseconds (408 past it, and the connection is
closed). A progress bound, not a total-transfer one: a body that
keeps arriving is fine at any size the byte limits allow; one
that stalls fails deterministically instead of holding a
connection slot and a pooled Lua state. 0 disables the bound.
max_form_parts: usizeMaximum number of parts in a multipart/form-data body.
max_field_bytes: u64Maximum size of a single non-file form field, in bytes. Fields become Lua strings, so this bounds what a request can push into a state’s heap.
max_file_bytes: u64Maximum size of a single uploaded file, in bytes. Files stream to
disk in Rust and never enter the Lua heap, so this is far larger
than max_field_bytes.
Trait Implementations§
Source§impl Clone for LimitsConfig
impl Clone for LimitsConfig
Source§impl Debug for LimitsConfig
impl Debug for LimitsConfig
Source§impl Default for LimitsConfig
impl Default for LimitsConfig
Source§impl<'de> Deserialize<'de> for LimitsConfigwhere
LimitsConfig: Default,
impl<'de> Deserialize<'de> for LimitsConfigwhere
LimitsConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for LimitsConfig
impl RefUnwindSafe for LimitsConfig
impl Send for LimitsConfig
impl Sync for LimitsConfig
impl Unpin for LimitsConfig
impl UnsafeUnpin for LimitsConfig
impl UnwindSafe for LimitsConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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