pub struct YamlValidationContext { /* private fields */ }Expand description
The consumers that must accept a YAML region, derived from (flavor, location). Validation rejects a region iff any active consumer rejects it.
Implementations§
Source§impl YamlValidationContext
impl YamlValidationContext
Sourcepub const fn substrate() -> Self
pub const fn substrate() -> Self
The abstract YAML-1.2 substrate: run every 1.2 check and no consumer-only checks. This is the contract the yaml-test-suite holds the validator to, so its verdicts are independent of any flavor/location.
Sourcepub fn new(flavor: Flavor, location: YamlLocation) -> Self
pub fn new(flavor: Flavor, location: YamlLocation) -> Self
Build a production context for a (flavor, location).
Sourcepub fn frontmatter(flavor: Flavor) -> Self
pub fn frontmatter(flavor: Flavor) -> Self
Convenience: a frontmatter context for flavor.
Sourcepub const fn is_substrate(&self) -> bool
pub const fn is_substrate(&self) -> bool
True for the 1.2 substrate path (suite tests). Consumer-only checks must never run here.
Sourcepub const fn consumers(&self) -> ConsumerSet
pub const fn consumers(&self) -> ConsumerSet
The active consumer set.
Sourcepub const fn any_rejects(&self, rejecting: ConsumerSet) -> bool
pub const fn any_rejects(&self, rejecting: ConsumerSet) -> bool
True when at least one active consumer is among rejecting — i.e. a
consumer-only check whose rejection set is rejecting should fire.
Trait Implementations§
Source§impl Clone for YamlValidationContext
impl Clone for YamlValidationContext
Source§fn clone(&self) -> YamlValidationContext
fn clone(&self) -> YamlValidationContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for YamlValidationContext
Source§impl Debug for YamlValidationContext
impl Debug for YamlValidationContext
impl Eq for YamlValidationContext
Source§impl PartialEq for YamlValidationContext
impl PartialEq for YamlValidationContext
Source§fn eq(&self, other: &YamlValidationContext) -> bool
fn eq(&self, other: &YamlValidationContext) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for YamlValidationContext
Auto Trait Implementations§
impl Freeze for YamlValidationContext
impl RefUnwindSafe for YamlValidationContext
impl Send for YamlValidationContext
impl Sync for YamlValidationContext
impl Unpin for YamlValidationContext
impl UnsafeUnpin for YamlValidationContext
impl UnwindSafe for YamlValidationContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more