///|
/// Resource limits applied before and during header parsing.
pub struct Limits {
max_input_bytes : Int
max_ranges : Int
max_digits_per_number : Int
max_unit_bytes : Int
max_raw_other_range_bytes : Int
} derive(Eq, Debug)
///|
pub fn Limits::default() -> Limits {
{
max_input_bytes: 8_192,
max_ranges: 32,
max_digits_per_number: 19,
max_unit_bytes: 64,
max_raw_other_range_bytes: 4_096,
}
}
///|
pub fn Limits::strict() -> Limits {
{
max_input_bytes: 1_024,
max_ranges: 8,
max_digits_per_number: 19,
max_unit_bytes: 32,
max_raw_other_range_bytes: 512,
}
}
///|
pub fn Limits::permissive() -> Limits {
{
max_input_bytes: 65_536,
max_ranges: 256,
max_digits_per_number: 19,
max_unit_bytes: 256,
max_raw_other_range_bytes: 32_768,
}
}
///|
pub fn Limits::max_input_bytes(self : Limits) -> Int {
self.max_input_bytes
}
///|
pub fn Limits::max_ranges(self : Limits) -> Int {
self.max_ranges
}
///|
pub fn Limits::max_digits_per_number(self : Limits) -> Int {
self.max_digits_per_number
}
///|
pub fn Limits::max_unit_bytes(self : Limits) -> Int {
self.max_unit_bytes
}
///|
pub fn Limits::max_raw_other_range_bytes(self : Limits) -> Int {
self.max_raw_other_range_bytes
}