#[non_exhaustive]pub struct Verdict {
pub path: Vec<Seg>,
pub kind: VerdictKind,
}Expand description
One thing a check has to say about a document: which node, and what is wrong with it — or that it could not be checked. A clean document has none.
#[non_exhaustive]: a verdict gains context (a span, once fig exposes one)
the same way an Issue does. Read the fields; build one
only through Schema::check.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.path: Vec<Seg>The node, as a concrete path. Kept as segments rather than rendered so
an editor can find the row again; Verdict::at is the text.
kind: VerdictKindWhat was found.
Implementations§
Source§impl Verdict
impl Verdict
Sourcepub fn at(&self) -> String
pub fn at(&self) -> String
The node as a dotted path — audience[1], meta.author, and the empty
string for the root. Spelled by render_path, so it agrees with a
Finding and with fig’s own Warning.
Sourcepub fn is_error(&self) -> bool
pub fn is_error(&self) -> bool
Whether this says the document is wrong: a type mismatch, or a rejection that is not merely unchecked. A warning is neither — it changes only what a reader sees.
Sourcepub fn is_unchecked(&self) -> bool
pub fn is_unchecked(&self) -> bool
Whether this says the node was not checked — its constraint is of a
kind the validator does not know, so it failed closed. Not an error
about the document, and not a warning either: a reader reports it
under its own heading, and a run with nothing else amiss is neither
valid nor invalid. See IssueKind::Unchecked.