pub struct Limits {Show 20 fields
pub max_reader_input_bytes: Option<usize>,
pub max_depth: Option<usize>,
pub max_nodes: Option<usize>,
pub max_buffered_comment_events: Option<usize>,
pub simple_key_max_lookahead: Option<usize>,
pub flow_nesting_limit: Option<usize>,
pub max_events: Option<usize>,
pub max_aliases: Option<usize>,
pub max_anchors: Option<usize>,
pub max_recorded_anchor_events: Option<usize>,
pub max_recorded_anchor_bytes: Option<usize>,
pub max_property_expansion_depth: Option<usize>,
pub max_total_property_interpolation_work: Option<usize>,
pub max_inclusion_depth: Option<u32>,
pub max_documents: Option<usize>,
pub max_total_scalar_bytes: Option<usize>,
pub max_total_comment_bytes: Option<usize>,
pub max_merge_keys: Option<usize>,
pub alias_anchor_min_aliases: Option<usize>,
pub alias_anchor_ratio_multiplier: Option<usize>,
}input-toml or input-yaml only.Expand description
Overrides for the limits a text is held to, one per field. None
leaves the field to the next tier.
Each field is decided on its own, highest first:
- the call:
Input::limits; - with
input-yaml, the repository:limits:in.ctl/input.yaml, installed byuse_repo_limits; - the process:
set_default_limits, orApp::input_limits; - the default: ctl-core’s for the three fields every format reads, and serde-saphyr’s for the YAML-only fields.
A repository beats the CLI’s default because the user owns the repository, as a user’s environment beats the CLI’s built-in width.
The field set follows the enabled format features.
max_reader_input_bytes, max_depth, and max_nodes exist in
every build, and the YAML-only fields exist with input-yaml.
Cargo enables a feature for every crate in a build, so another
crate can add fields to a build of yours. Build a value with
..Limits::NONE, as in Limits { max_depth: Some(8), ..Limits::NONE }, and it compiles whatever the build enables.
enforce_alias_anchor_ratio is not here: the ratio check is one
comparison after scanning, so turning it off saves nothing. It
stays on; its multiplier and minimum alias count are overridable.
Fields§
§max_reader_input_bytes: Option<usize>Bytes of input text. Also checked for text already in memory.
max_depth: Option<usize>Nesting of YAML sequences and mappings, or of TOML arrays and tables, with the root table as 1.
max_nodes: Option<usize>YAML sequences, mappings, and scalars in total; in TOML, the root table and every table, array, and value.
max_buffered_comment_events: Option<usize>input-yaml only.Comment events buffered while resolving an ambiguous entry.
simple_key_max_lookahead: Option<usize>input-yaml only.Characters scanned to resolve a simple key.
flow_nesting_limit: Option<usize>input-yaml only.Simultaneously nested flow collections.
max_events: Option<usize>input-yaml only.Parser events in total.
max_aliases: Option<usize>input-yaml only.Alias (*ref) events.
max_anchors: Option<usize>input-yaml only.Distinct anchor (&anchor) definitions.
max_recorded_anchor_events: Option<usize>input-yaml only.Event copies retained for anchors.
max_recorded_anchor_bytes: Option<usize>input-yaml only.Bytes of string payload retained for anchors.
max_property_expansion_depth: Option<usize>input-yaml only.Nested expansions in one property interpolation.
max_total_property_interpolation_work: Option<usize>input-yaml only.Bytes inspected across all property interpolation.
max_inclusion_depth: Option<u32>input-yaml only.Nesting of !include.
max_documents: Option<usize>input-yaml only.YAML documents in one text.
max_total_scalar_bytes: Option<usize>input-yaml only.Bytes of scalar text in total.
max_total_comment_bytes: Option<usize>input-yaml only.Bytes of comment text in total.
max_merge_keys: Option<usize>input-yaml only.Merge keys (<<). ctl-core refuses merge keys whatever this says.
alias_anchor_min_aliases: Option<usize>input-yaml only.Aliases allowed before the alias-to-anchor ratio applies.
alias_anchor_ratio_multiplier: Option<usize>input-yaml only.How many aliases each anchor may have once the ratio applies.
Implementations§
Source§impl Limits
impl Limits
Sourcepub const DEFAULT_MAX_READER_INPUT_BYTES: usize
pub const DEFAULT_MAX_READER_INPUT_BYTES: usize
max_reader_input_bytes when no tier sets it: 256 MiB.
Sourcepub const DEFAULT_MAX_DEPTH: usize = 64
pub const DEFAULT_MAX_DEPTH: usize = 64
max_depth when no tier sets it.
Sourcepub const DEFAULT_MAX_NODES: usize = 250_000
pub const DEFAULT_MAX_NODES: usize = 250_000
max_nodes when no tier sets it.