Skip to main content

Limits

Struct Limits 

Source
pub struct Limits {
Show 20 fields pub max_reader_input_bytes: 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_depth: Option<usize>, pub max_inclusion_depth: Option<u32>, pub max_documents: Option<usize>, pub max_nodes: 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>,
}
Expand description

Overrides for serde-saphyr’s Budget, one per field. None leaves the field to the next tier.

Each field is decided on its own, highest first:

  1. the call: Input::limits;
  2. the repository: limits: in REPO_FILE, installed by use_repo_limits;
  3. the process: set_default_limits, or App::input_limits;
  4. serde-saphyr’s own default.

A repository beats a tool’s default because the operator owns it, as an operator’s environment beats a tool’s built-in width.

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_buffered_comment_events: Option<usize>

Comment events buffered while resolving an ambiguous entry.

§simple_key_max_lookahead: Option<usize>

Characters scanned to resolve a simple key.

§flow_nesting_limit: Option<usize>

Simultaneously nested flow collections.

§max_events: Option<usize>

Parser events in total.

§max_aliases: Option<usize>

Alias (*ref) events.

§max_anchors: Option<usize>

Distinct anchor (&anchor) definitions.

§max_recorded_anchor_events: Option<usize>

Event copies retained for anchors.

§max_recorded_anchor_bytes: Option<usize>

Bytes of string payload retained for anchors.

§max_property_expansion_depth: Option<usize>

Nested expansions in one property interpolation.

§max_total_property_interpolation_work: Option<usize>

Bytes inspected across all property interpolation.

§max_depth: Option<usize>

Nesting of sequences and mappings.

§max_inclusion_depth: Option<u32>

Nesting of !include.

§max_documents: Option<usize>

YAML documents in one text.

§max_nodes: Option<usize>

Sequences, mappings, and scalars in total.

§max_total_scalar_bytes: Option<usize>

Bytes of scalar text in total.

§max_total_comment_bytes: Option<usize>

Bytes of comment text in total.

§max_merge_keys: Option<usize>

Merge keys (<<). ctl-core refuses merge keys whatever this says.

§alias_anchor_min_aliases: Option<usize>

Aliases allowed before the alias-to-anchor ratio applies.

§alias_anchor_ratio_multiplier: Option<usize>

How many aliases each anchor may have once the ratio applies.

Implementations§

Source§

impl Limits

Source

pub const NONE: Self

No overrides: every field falls through.

Source

pub fn or(self, lower: &Self) -> Self

self, with each unset field taken from lower.

Source

pub fn budget(&self) -> Budget

serde-saphyr’s defaults with these overrides applied.

Trait Implementations§

Source§

impl Clone for Limits

Source§

fn clone(&self) -> Self

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 Limits

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Limits

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Limits
where Limits: Default,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Limits

Source§

impl PartialEq for Limits

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Limits

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, O> Matches<O> for T
where T: PartialEq<O>,

Source§

fn validate_matches(&self, other: &O) -> bool

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.