pub struct ResourceLimits {
pub source_bytes_max: usize,
pub zone_count_max: usize,
pub rule_count_max: usize,
pub link_count_max: usize,
pub leap_count_max: usize,
pub link_chain_depth_max: usize,
pub zone_era_count_max: usize,
}Expand description
Generous reliability caps on input-driven resource dimensions. Default is the production set;
tests construct tiny instances to exercise enforcement without giant fixtures, and a future CLI
(T17.2) can expose overrides.
Fields§
§source_bytes_max: usizeMaximum bytes in any single source file (checked before parsing each file).
zone_count_max: usizeMaximum number of Zone records in the assembled database.
rule_count_max: usizeMaximum number of Rule rows in any one named rule set.
link_count_max: usizeMaximum number of Link records in the assembled database.
leap_count_max: usizeMaximum number of leap-second-table entries.
link_chain_depth_max: usizeMaximum link-chain resolution depth.
zone_era_count_max: usizeMaximum continuation eras within a single Zone.
Implementations§
Source§impl ResourceLimits
impl ResourceLimits
Sourcepub fn check_source_bytes(&self, len: usize, path: &Path) -> Result<()>
pub fn check_source_bytes(&self, len: usize, path: &Path) -> Result<()>
Reject a source file whose byte length exceeds Self::source_bytes_max. Checked once per
file, before it is handed to the parser (so an oversize input never gets fully tokenised).
Sourcepub fn check_leap_count(&self, n: usize) -> Result<()>
pub fn check_leap_count(&self, n: usize) -> Result<()>
Reject a leap-second table with more than Self::leap_count_max entries.
Trait Implementations§
Source§impl Clone for ResourceLimits
impl Clone for ResourceLimits
Source§fn clone(&self) -> ResourceLimits
fn clone(&self) -> ResourceLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more