pub struct Limits {
pub decompressed_bytes: u64,
pub compression_ratio: u64,
pub rows_per_category: u64,
pub nesting_depth: u32,
pub dictionary_entries: u32,
}Expand description
Ceilings that turn hostile input into diagnostics rather than exhaustion.
Fields§
§decompressed_bytes: u64Largest accepted size after decompression, in bytes.
Defaults to 16 GiB. The ratio ceiling (Self::compression_ratio)
bounds expansion relative to the bytes supplied; this absolute ceiling
additionally stops a hostile or corrupt input from exhausting memory
before any parse. A caller reading a genuinely larger file raises it, or
uses Limits::unbounded to opt out of every absolute ceiling.
compression_ratio: u64Largest accepted ratio of decompressed to compressed size.
rows_per_category: u64Largest accepted declared row count for one category.
Defaults to 2^28 rows; Limits::unbounded removes the ceiling.
nesting_depth: u32Deepest accepted nesting.
dictionary_entries: u32Largest accepted identifier dictionary.
Defaults to 2^24 entries; Limits::unbounded removes the ceiling.
Implementations§
Source§impl Limits
impl Limits
Sourcepub const fn unbounded() -> Limits
pub const fn unbounded() -> Limits
Limits with no absolute ceiling, for trusted input of any size.
The compression-ratio and nesting-depth ceilings still apply: they protect against malformed input rather than large input.
Sourcepub fn exceeded(limit: &'static str, value: impl Display) -> Diagnostic
pub fn exceeded(limit: &'static str, value: impl Display) -> Diagnostic
Builds the registered finding for a violated ceiling.
Trait Implementations§
impl Copy for Limits
impl Eq for Limits
impl StructuralPartialEq for Limits
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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