pub struct Limits {Show 24 fields
pub max_header_size_bytes: usize,
pub max_header_count: usize,
pub max_header_name_bytes: usize,
pub max_header_value_bytes: usize,
pub max_body_size_bytes: usize,
pub max_body_buffer_bytes: usize,
pub max_body_inspection_bytes: usize,
pub max_decompression_ratio: f32,
pub max_decompressed_size_bytes: usize,
pub max_connections_per_client: usize,
pub max_connections_per_route: usize,
pub max_total_connections: usize,
pub max_idle_connections_per_upstream: usize,
pub max_in_flight_requests: usize,
pub max_in_flight_requests_per_worker: usize,
pub max_queued_requests: usize,
pub max_agent_queue_depth: usize,
pub max_agent_body_bytes: usize,
pub max_agent_response_bytes: usize,
pub max_requests_per_second_global: Option<u32>,
pub max_requests_per_second_per_client: Option<u32>,
pub max_requests_per_second_per_route: Option<u32>,
pub max_memory_bytes: Option<usize>,
pub max_memory_percent: Option<f32>,
}Expand description
System-wide limits configuration
Fields§
§max_header_size_bytes: usize§max_header_count: usize§max_header_name_bytes: usize§max_header_value_bytes: usize§max_body_size_bytes: usize§max_body_buffer_bytes: usize§max_body_inspection_bytes: usize§max_decompression_ratio: f32§max_decompressed_size_bytes: usize§max_connections_per_client: usize§max_connections_per_route: usize§max_total_connections: usize§max_idle_connections_per_upstream: usize§max_in_flight_requests: usize§max_in_flight_requests_per_worker: usize§max_queued_requests: usize§max_agent_queue_depth: usize§max_agent_body_bytes: usize§max_agent_response_bytes: usize§max_requests_per_second_global: Option<u32>§max_requests_per_second_per_client: Option<u32>§max_requests_per_second_per_route: Option<u32>§max_memory_bytes: Option<usize>§max_memory_percent: Option<f32>Implementations§
Source§impl Limits
impl Limits
Sourcepub fn for_testing() -> Self
pub fn for_testing() -> Self
Create limits suitable for testing (more permissive)
Sourcepub fn for_production() -> Self
pub fn for_production() -> Self
Create limits suitable for production (more restrictive)
Sourcepub fn validate(&self) -> SentinelResult<()>
pub fn validate(&self) -> SentinelResult<()>
Validate the limits configuration
Sourcepub fn check_header_size(&self, size: usize) -> SentinelResult<()>
pub fn check_header_size(&self, size: usize) -> SentinelResult<()>
Check if a header size exceeds limits
Sourcepub fn check_header_count(&self, count: usize) -> SentinelResult<()>
pub fn check_header_count(&self, count: usize) -> SentinelResult<()>
Check if header count exceeds limits
Sourcepub fn check_body_size(&self, size: usize) -> SentinelResult<()>
pub fn check_body_size(&self, size: usize) -> SentinelResult<()>
Check if body size exceeds limits
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Limits
impl<'de> Deserialize<'de> for Limits
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnwindSafe for Limits
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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