pub struct ControlLimits {
pub budget: Option<usize>,
pub line_limit: Option<usize>,
}Expand description
The two bounds on the control state one index retains, each liftable on its own.
They bound different things. The budget bounds the memory the whole table retains; the
line limit bounds what one pattern costs to match against every entry. So raising the
budget admits more files without admitting longer lines, and lifting the line limit
admits long lines without retaining more. A source either bound cannot admit is
refused, and its ControlRefusalReason names the one that fired.
Both are part of the scan scope: they decide which rules apply, so a snapshot taken under other limits never serves a request for these.
Fields§
§budget: Option<usize>Bytes of retained charge before further sources are refused, or None for no
bound.
Each directory’s key and each distinct source’s bytes and matcher are charged, so
identical files count once. It also bounds the read: a control file is read to one
byte past the budget, so None reads every control file whole, however large.
line_limit: Option<usize>Longest line in bytes a source may hold before it is refused whole, or None for
no bound.
Implementations§
Source§impl ControlLimits
impl ControlLimits
Sourcepub const fn limit_for(self, reason: ControlRefusalReason) -> Option<usize>
pub const fn limit_for(self, reason: ControlRefusalReason) -> Option<usize>
The limit a refusal for reason crossed, or None when that limit is unbounded.
Trait Implementations§
Source§impl Clone for ControlLimits
impl Clone for ControlLimits
Source§fn clone(&self) -> ControlLimits
fn clone(&self) -> ControlLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ControlLimits
Source§impl Debug for ControlLimits
impl Debug for ControlLimits
Source§impl Default for ControlLimits
impl Default for ControlLimits
Source§impl Display for ControlLimits
budget 4.0 MiB, line limit 16 KiB, with all for an unbounded limit, the word every
surface accepts back.
impl Display for ControlLimits
budget 4.0 MiB, line limit 16 KiB, with all for an unbounded limit, the word every
surface accepts back.