pub enum DiagnosticTarget {
Header(HeaderPath),
MissingHeader {
parent: HeaderPath,
matcher: String,
},
Document,
Frontmatter {
block: Option<FrontmatterBlock>,
},
}Expand description
What a diagnostic is about.
The four cases carry text of different provenance, and conflating them in
one HeaderPath silently mixes document text with schema text. Only
Self::Header names text that occurs in the document; the matcher label
in Self::MissingHeader comes from the schema and may occur nowhere in
the document; Self::Document and Self::Frontmatter name no header
at all.
Variants§
Header(HeaderPath)
A header that exists in the document, named by its document path.
MissingHeader
A section the schema requires but the document does not contain.
Fields
parent: HeaderPathDocument path of the header whose scope should have contained it.
Empty when no header encloses the missing section: it belongs to the
document root’s scope (including a missing h1 title), or the
sugar’s single-h1 voice reports its sections scope as the
document’s.
Document
The document as a whole, when no single header can name the violation.
Used for the document root’s scope, which has no parent header, and for
the sugar’s single-h1 document voice described by specification §6.2.
Frontmatter
A frontmatter block, or a value inside one. Has no header path.
Fields
block: Option<FrontmatterBlock>The offending block, absent only when the document has none.
Trait Implementations§
Source§impl Clone for DiagnosticTarget
impl Clone for DiagnosticTarget
Source§fn clone(&self) -> DiagnosticTarget
fn clone(&self) -> DiagnosticTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiagnosticTarget
impl Debug for DiagnosticTarget
impl Eq for DiagnosticTarget
Source§impl PartialEq for DiagnosticTarget
impl PartialEq for DiagnosticTarget
impl StructuralPartialEq for DiagnosticTarget
Auto Trait Implementations§
impl Freeze for DiagnosticTarget
impl RefUnwindSafe for DiagnosticTarget
impl Send for DiagnosticTarget
impl Sync for DiagnosticTarget
impl Unpin for DiagnosticTarget
impl UnsafeUnpin for DiagnosticTarget
impl UnwindSafe for DiagnosticTarget
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.