Skip to main content

BudgetBreach

Enum BudgetBreach 

Source
#[non_exhaustive]
pub enum BudgetBreach {
Show 17 variants Events { events: usize, }, Aliases { aliases: usize, }, Anchors { anchors: usize, }, Depth { depth: usize, }, InclusionDepth { depth: u32, }, Documents { documents: usize, }, Nodes { nodes: usize, }, ScalarBytes { total_scalar_bytes: usize, }, CommentBytes { total_comment_bytes: usize, }, MergeKeys { merge_keys: usize, }, AliasAnchorRatio { aliases: usize, anchors: usize, }, SequenceUnbalanced, InputBytes { input_bytes: usize, }, RecordedAnchorEvents { recorded_anchor_events: usize, }, RecordedAnchorBytes { recorded_anchor_bytes: usize, }, PropertyExpansionDepth { depth: usize, max_depth: usize, }, PropertyInterpolationWork { work: usize, max_work: usize, },
}
Expand description

What tripped the budget (if anything).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Events

The total number of parser events exceeded Budget::max_events.

Fields

§events: usize

Total events observed at the moment of the breach.

§

Aliases

The number of alias events (*ref) exceeded Budget::max_aliases.

Fields

§aliases: usize

Total alias events observed at the moment of the breach.

§

Anchors

The number of distinct anchors defined exceeded Budget::max_anchors.

Fields

§anchors: usize

Total distinct anchors observed at the moment of the breach.

§

Depth

The structural nesting depth exceeded Budget::max_depth.

Depth counts nested SequenceStart and MappingStart events.

Fields

§depth: usize

Maximum depth reached when the breach occurred.

§

InclusionDepth

The include nesting depth exceeded Budget::max_inclusion_depth.

Fields

§depth: u32

Include nesting depth reached when the breach occurred.

§

Documents

The number of YAML documents exceeded Budget::max_documents.

Fields

§documents: usize

Total documents observed at the moment of the breach.

§

Nodes

The number of nodes exceeded Budget::max_nodes.

Nodes are SequenceStart, MappingStart, and Scalar events.

Fields

§nodes: usize

Total nodes observed at the moment of the breach.

§

ScalarBytes

The cumulative size of scalar contents exceeded Budget::max_total_scalar_bytes.

Fields

§total_scalar_bytes: usize

Sum of Scalar.value.len() over all scalars seen so far.

§

CommentBytes

The cumulative size of comment contents exceeded Budget::max_total_comment_bytes.

Fields

§total_comment_bytes: usize

Sum of comment text lengths over all comments seen so far.

§

MergeKeys

The number of merge keys (<<) exceeded Budget::max_merge_keys.

Fields

§merge_keys: usize

Total merge keys observed at the moment of the breach.

§

AliasAnchorRatio

The ratio of aliases to defined anchors is excessive.

Triggered when Budget::enforce_alias_anchor_ratio is true and aliases > alias_anchor_ratio_multiplier × anchors (after scanning), once aliases >= alias_anchor_min_aliases to avoid tiny-input false positives.

Fields

§aliases: usize

Total alias events seen.

§anchors: usize

Total distinct anchors defined (by id) in the input.

§

SequenceUnbalanced

Unbalanced structure: a closing event was encountered without a matching opening event (depth underflow). Indicates malformed or truncated input.

§

InputBytes

The total number of input bytes exceeded Budget::max_reader_input_bytes.

Fields

§input_bytes: usize

Total number of bytes consumed from the input when the breach occurred.

§

RecordedAnchorEvents

Retained anchor event copies exceeded Budget::max_recorded_anchor_events.

Fields

§recorded_anchor_events: usize

Cumulative copies attempted at the moment of the breach.

§

RecordedAnchorBytes

Owned payload copied into retained anchor events exceeded Budget::max_recorded_anchor_bytes.

Fields

§recorded_anchor_bytes: usize

Cumulative owned payload bytes attempted at the moment of the breach.

§

PropertyExpansionDepth

Property operator text exceeded Budget::max_property_expansion_depth.

Fields

§depth: usize

Nested expansion depth attempted at the moment of the breach.

§max_depth: usize

Configured maximum nested expansion depth.

§

PropertyInterpolationWork

Property interpolation exceeded Budget::max_total_property_interpolation_work.

Fields

§work: usize

Cumulative work attempted at the moment of the breach.

§max_work: usize

Configured maximum cumulative work.

Trait Implementations§

Source§

impl Clone for BudgetBreach

Source§

fn clone(&self) -> BudgetBreach

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BudgetBreach

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.