#[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
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.
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.
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.
NoTerms
The vocabulary declares no terms.
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.
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.
NotAString
A term’s label: or description: that is not a string, which the
parser drops.
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.
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.
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.
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.