#[non_exhaustive]pub struct Finding {
pub kind: FindingKind,
pub at: String,
pub document: Option<PathBuf>,
}Expand description
One thing the lint has to say about a vocabulary document.
#[non_exhaustive]: a finding gains context (a span, a source document) the
same way Issue does. Read the fields; build one only
through lint_vocabulary.
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.kind: FindingKindWhat was found.
at: StringWhere, as a fig path into the document (terms.public.retired). Empty
for a finding about the document as a whole.
A path rather than a line and column because that is the most a caller
can be given: fig hands back a Value tree with no per-node spans, so
nothing downstream of a parse knows which line a key came from. It is
also how fig’s own Warning addresses a node, so the two agree.
document: Option<PathBuf>Which document, when the finding is one of several documents’ —
load_schema follows includes and from
references, and a finding in one of those names it here. None from
lint_vocabulary, which judges the one document it was given.
Implementations§
Source§impl Finding
impl Finding
Sourcepub fn is_error(&self) -> bool
pub fn is_error(&self) -> bool
Whether this changes what validation does, rather than only what a
reader sees. See the module docs for the rule; see each
FindingKind for why it falls where it does.
Matched exhaustively despite FindingKind being #[non_exhaustive],
which binds downstream and not here: a new kind should stop this
compiling until somebody decides which side of the rule it falls on.
Defaulting it to a note would be deciding by omission.