pub struct Limits {Show 23 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>,
pub max_total_replayed_events: Option<usize>,
pub max_replay_stack_depth: Option<usize>,
pub max_alias_expansions_per_anchor: Option<usize>,
}json or toml or 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
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 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, of TOML arrays and tables, or of JSON arrays and objects, with the root table or container as 1. Raising it far above its default lets a deep text overflow the stack in any format, because dropping or deserializing the tree recurses once per level.
max_nodes: Option<usize>YAML sequences, mappings, and scalars in total; in TOML, the root table and every table, array, and value; in JSON, every array, object, and value, with no count of keys.
max_buffered_comment_events: Option<usize>yaml only.Comment events buffered while resolving an ambiguous entry.
simple_key_max_lookahead: Option<usize>yaml only.Characters scanned to resolve a simple key.
flow_nesting_limit: Option<usize>yaml only.Simultaneously nested flow collections.
max_events: Option<usize>yaml only.Parser events in total.
max_aliases: Option<usize>yaml only.Alias (*ref) events.
max_anchors: Option<usize>yaml only.Distinct anchor (&anchor) definitions.
max_recorded_anchor_events: Option<usize>yaml only.Event copies retained for anchors.
max_recorded_anchor_bytes: Option<usize>yaml only.Bytes of string payload retained for anchors.
max_property_expansion_depth: Option<usize>yaml only.Nested expansions in one property interpolation.
max_total_property_interpolation_work: Option<usize>yaml only.Bytes inspected across all property interpolation.
max_inclusion_depth: Option<u32>yaml only.Nesting of !include.
max_documents: Option<usize>yaml only.YAML documents in one text.
max_total_scalar_bytes: Option<usize>yaml only.Bytes of scalar text in total.
max_total_comment_bytes: Option<usize>yaml only.Bytes of comment text in total.
max_merge_keys: Option<usize>yaml only.Merge keys (<<). ctl-core refuses merge keys whatever this says.
alias_anchor_min_aliases: Option<usize>yaml only.Aliases allowed before the alias-to-anchor ratio applies.
alias_anchor_ratio_multiplier: Option<usize>yaml only.How many aliases each anchor may have once the ratio applies.
max_total_replayed_events: Option<usize>yaml only.Events the aliases of a text replay in total, nested aliases included.
max_replay_stack_depth: Option<usize>yaml only.Nesting of aliases inside aliases.
max_alias_expansions_per_anchor: Option<usize>yaml only.Times one anchor may be used through an alias.
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.