Skip to main content

FindingKind

Enum FindingKind 

Source
#[non_exhaustive]
pub enum FindingKind {
Show 18 variants NotAVocabulary, FieldEmpty, ValuesUnreadable { spelling: String, }, TermKeyNotAString, RetiredUnreadable { spelling: String, }, DuplicateTerm { disagree_retired: bool, }, NoTerms { closed: bool, }, NothingOffered, UnknownKey { key: String, }, TintNotRead, TintUnreadable { spelling: String, }, NotAString { key: String, }, TermSpecIgnored, CaseOnlyDuplicate { other: String, }, FieldDisagrees { field: String, }, GuardWithoutTerm { value: String, }, IncludedTwice, Shadowed { by: String, },
}
Expand description

The kind of a Finding.

#[non_exhaustive]: the crate learns new silences as it grows, so a match needs a _ arm.

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.
§

NotAVocabulary

No vocabulary.field, so parse_vocabulary returns None and this is not a vocabulary document at all. Nothing else is checked once this is found — every later finding would be about a document the parser never reads.

§

FieldEmpty

vocabulary.field is the empty string. It loads, and then nothing can point a rule at it.

§

ValuesUnreadable

vocabulary.values is present and is neither closed nor open.

An error, and the one this module exists for: the parser asks only whether the spelling is exactly closed, so cloesd, Closed and close all load as an open vocabulary that forbids nothing.

Fields

§spelling: String

The spelling as written, so the message can quote it back.

§

TermKeyNotAString

A key under terms that is not a string, which the parser skips entirely — the term is not merely stripped of its metadata, it is gone.

§

RetiredUnreadable

A term’s retired: that is not a bool. An error: the parser reads it as not retired, so a value the author withdrew keeps being offered.

Fields

§spelling: String

How it was written.

§

DuplicateTerm

The same term value declared more than once. Both survive, in declaration order, so a picker offers the value twice.

An error only when the copies disagree about retired: the first live one wins the membership test, so a term that is retired in one entry and live in another validates as live and the retirement never takes effect.

Fields

§disagree_retired: bool

Whether the copies disagree about retired.

§

NoTerms

The vocabulary declares no terms.

Fields

§closed: bool

Whether the vocabulary is closed, in which case it rejects every value there is.

§

NothingOffered

A closed vocabulary in which every term is retired: no value can be entered afresh, because the known ones are all withdrawn and every other is rejected.

§

UnknownKey

A key nothing reads, inside vocabulary or inside a term’s spec. A note: the document says something and the parser ignores it, but nothing is wrongly accepted. vocabulary.value = closed is the shape that stings, and it is a note here only because ValuesUnreadable cannot see it.

Fields

§key: String

The key as written.

§

TintNotRead

A term declared a tint: when parse_vocabulary did not read one. No longer produced: the parser reads the key since the release that shipped the schema document loader, and a spelling it cannot map is TintUnreadable. The variant stays because removing one is a break for every match downstream.

§

TintUnreadable

A tint: — on a term, or on a rule — spelled as none of accent, neutral, positive, warning, danger. A note: the tint is dropped and the field or term draws untinted, which is a presenter failing open.

Fields

§spelling: String

How it was written.

§

NotAString

A term’s label: or description: that is not a string, which the parser drops.

Fields

§key: String

Which key.

§

TermSpecIgnored

A term whose spec is a non-null scalar or a sequence — public: Anyone rather than public: { description: Anyone }. Every lookup misses, so it loads as a bare term and whatever was written is dropped.

§

CaseOnlyDuplicate

Two live terms whose values differ only by case. Both are real, distinct values (membership is compared exactly), but a reader cannot tell them apart in a picker and the near-miss suggestion between them is settled by declaration order.

Fields

§other: String

The term this one collides with.

§

FieldDisagrees

A rule’s vocabulary was loaded from a document whose field names a different path from the rule’s at. The rule’s at wins — that is what from means — so this is a note: the document’s own field is read by nothing here.

Fields

§field: String

The field the vocabulary document declares.

§

GuardWithoutTerm

An on_change.when naming a value the rule’s vocabulary has no term for. An error, and the reason guards_without_terms exists: the guard never fires, and the user commits the change the author warned about hardest with no warning at all.

Fields

§value: String

The value the guard names.

§

IncludedTwice

An include of a document this schema already includes. Both copies are spliced, and the second shadows nothing — so a note.

§

Shadowed

A rule every one of whose paths an earlier rule also matches, so it can never govern anything. A note, and the one finding that needs the whole loaded schema rather than one document: ** written before anything is the usual way to get one.

Fields

§by: String

The rule that shadows it, by its origin.

Trait Implementations§

Source§

impl Clone for FindingKind

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 FindingKind

Source§

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

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

impl Eq for FindingKind

Source§

impl PartialEq for FindingKind

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 FindingKind

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.