#[non_exhaustive]pub enum WarningType {
Show 50 variants
AttributeValueMissingTerminatingQuote,
DocumentHeaderNotTerminated,
NoInlineDoctypeCandidate,
EmptyAttributeValue,
EmptyShorthandName,
InvalidMacroName,
MediaMacroMissingTarget,
MacroMissingAttributeList,
MacroMissingSeparator,
MissingCommaAfterQuotedAttributeValue,
UnterminatedDelimitedBlock,
MissingBlockAfterTitleOrAttributeList,
EmptyBlockAnchorName,
InvalidBlockAnchorName,
AttributeValueIsLocked(String),
DuplicateId(String),
Level0SectionHeadingNotSupported,
SectionHeadingLevelSkipped(usize, usize),
SectionHeadingLevelExceedsMaximum(usize),
SectionHeadingLevelOutOfRange(i32, usize),
LeveloffsetExcludesAllHeadingLevels(i32),
ListItemOutOfSequence(String, String),
NoCalloutFound(usize),
CalloutListItemOutOfSequence(usize, usize),
TableCellExceedsColumnCount,
TableCsvDataHasUnclosedQuote,
TableMissingLeadingSeparator,
TableIncompleteRowAtEndOfTable,
SkippingReferenceToMissingAttribute(String),
InvalidSubstitutionTypeForStemMacro(String),
InvalidSubstitutionTypeForPassthroughMacro(String),
InvalidSubstitutionTypeForBlock(String),
InvalidFootnoteReference(String),
DeprecatedFootnoterefMacro(String),
IncludeFileNotFound(String),
IncludeDroppedDueToMissingAttribute(String),
MaxIncludeDepthExceeded(usize),
MaxBlockNestingExceeded(usize),
NonUtf8IncludeEncoding(String),
MalformedConditionalDirective(String, String),
UnmatchedConditionalDirective(String),
MismatchedConditionalDirective(String),
UnterminatedConditionalDirective(String),
IncludeTagNotFound(String),
IncludeTagUnclosed(String),
IncludeTagMismatchedEnd(String, String),
IncludeTagUnexpectedEnd(String),
AbstractBlockInBookWithoutDoctitle,
PossibleInvalidReference(String),
UnsafeLinkSchemeRejected(String),
}Expand description
Type of possible parse error that was detected.
This enum is non_exhaustive: new conditions are recognized as the parser
grows, so a host matching on it needs a catch-all arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AttributeValueMissingTerminatingQuote
A quoted attribute value ran to the end of its line (or the end of the attribute list) without a matching closing quote.
DocumentHeaderNotTerminated
A document header was not followed by a blank line, so the line that follows it can not be parsed as part of the header.
NoInlineDoctypeCandidate
The inline doctype was requested for a document that holds no single
paragraph, verbatim, or raw block to convert.
EmptyAttributeValue
An element attribute was written with a name and = but no value.
EmptyShorthandName
A shorthand element attribute marker (. for a role, # for an ID, or
% for an option) was found with no name after it.
InvalidMacroName
The name in a block or inline macro is not a valid identifier.
MediaMacroMissingTarget
A media macro (image::, video::, or audio::) was written without
the target that names the media to embed.
MacroMissingAttributeList
A macro was written without the […] attribute list that terminates it.
MacroMissingSeparator
A block macro was written without the :: that separates its name from
its target.
MissingCommaAfterQuotedAttributeValue
A quoted attribute value in an attribute list was followed by something other than the comma that separates it from the next attribute.
UnterminatedDelimitedBlock
A delimited block was opened but the matching closing delimiter was never found, so the block runs to the end of the document.
MissingBlockAfterTitleOrAttributeList
A block title (.Title) or attribute list ([…]) was found at the end
of the document or immediately before a blank line, with no block for it
to describe.
EmptyBlockAnchorName
A block anchor ([[…]]) was written with no name between its brackets.
InvalidBlockAnchorName
A block anchor ([[…]]) names an ID containing characters that are not
permitted in a name.
AttributeValueIsLocked(String)
The document tried to set an attribute that the API caller locked when it configured the parser. The field is the attribute name.
DuplicateId(String)
An ID was assigned to an element when an earlier element had already registered it. The field is the duplicated ID.
Level0SectionHeadingNotSupported
A level-0 section heading (= Title) was found somewhere other than the
document header, where this crate does not support it.
SectionHeadingLevelSkipped(usize, usize)
A section heading skipped one or more levels below its parent. The fields are the expected level and the level actually found.
SectionHeadingLevelExceedsMaximum(usize)
A section heading nests deeper than the deepest supported level. The field is the level found.
SectionHeadingLevelOutOfRange(i32, usize)
A leveloffset shifted a section heading outside the supported range,
so its level was clamped. The fields are the offset level and the level
it was clamped to.
LeveloffsetExcludesAllHeadingLevels(i32)
A leveloffset is so large (or so negative) that no authored heading
level could land inside the supported range. The field is the offset.
ListItemOutOfSequence(String, String)
An explicitly-numbered list item does not continue the sequence its list established. The fields are the expected and actual indexes.
NoCalloutFound(usize)
A callout list item has no matching callout marker in the verbatim block it annotates. The field is the callout number.
CalloutListItemOutOfSequence(usize, usize)
A callout list item does not continue the sequence its list established. The fields are the expected and actual indexes.
TableCellExceedsColumnCount
A table row holds more cells than the table’s column count allows; the surplus cell is dropped.
TableCsvDataHasUnclosedQuote
A quoted field in a CSV-format table was never closed; the cell is set to empty.
TableMissingLeadingSeparator
A table row does not begin with the cell separator its table uses; parsing recovers by assuming one.
TableIncompleteRowAtEndOfTable
A table ended part-way through a row; the cells of that partial row are dropped.
SkippingReferenceToMissingAttribute(String)
An attribute reference ({name}) names an attribute that is not set,
under attribute-missing=warn. The field is the attribute name.
InvalidSubstitutionTypeForStemMacro(String)
A stem: macro named a substitution type that is not recognized. The
field is the unrecognized name.
InvalidSubstitutionTypeForPassthroughMacro(String)
A passthrough macro (pass:) named a substitution type that is not
recognized. The field is the unrecognized name.
InvalidSubstitutionTypeForBlock(String)
One or more unrecognized substitution names in a block’s subs
attribute. The names are joined with ", "; any recognized names in
the same list are still honored.
InvalidFootnoteReference(String)
A footnote reference (footnote:id[]) names an ID that was never
defined by an earlier footnote.
DeprecatedFootnoterefMacro(String)
The deprecated footnoteref:[…] macro was used outside compatibility
mode. The footnote macro with a target should be used instead.
IncludeFileNotFound(String)
An include:: directive named a file that the configured include file
handler could not resolve. The field is the target as written.
IncludeDroppedDueToMissingAttribute(String)
An include directive’s target referenced a missing attribute while
attribute-missing was set to warn, so the directive was dropped
without being resolved. (Under drop-line the directive line is
removed silently instead.) The field is the directive as written.
MaxIncludeDepthExceeded(usize)
An include directive was not expanded because the file containing it
already sits at the maximum include depth (the max-include-depth
attribute, possibly lowered by an enclosing include directive’s depth
attribute). The field is the relative maximum in effect – the number of
levels that were permitted below the file that established the limit –
matching the number Asciidoctor reports.
MaxBlockNestingExceeded(usize)
Block parsing reached the maximum nesting depth (the max-block-nesting
attribute, default 32, API-only) before the innermost content was
parsed, so the over-nested content was truncated rather than descended
into. This bounds native recursion – a delimited block’s body, a section
body, a table cell, or a nested list each parse on a fresh call stack –
so a crafted document cannot overflow the stack and abort the process.
The field is the limit in effect.
NonUtf8IncludeEncoding(String)
An include directive specified an encoding attribute whose value is
not UTF-8. The parser only handles UTF-8 content, so the requested
encoding cannot be honored.
MalformedConditionalDirective(String, String)
A conditional preprocessor directive (ifdef, ifndef, ifeval, or
endif) is malformed. The first field is the specific reason (e.g.
missing target, target not permitted, missing expression, invalid expression, text not permitted); the second is the offending
directive as written.
UnmatchedConditionalDirective(String)
An endif preprocessor directive was found with no matching open
conditional. The field is the offending directive as written.
MismatchedConditionalDirective(String)
An endif preprocessor directive names a different target than the
conditional it would close. The field is the offending directive as
written.
UnterminatedConditionalDirective(String)
A conditional preprocessor directive (ifdef, ifndef, or ifeval)
was opened but never closed by a matching endif. The field is the
opening directive as written.
IncludeTagNotFound(String)
One or more tags named by an include directive’s tag / tags
attribute were never found in the include file. The field is the
pre-formatted, pluralized subject – tag '<name>' for a single missing
tag, or tags '<name>, <name>' (comma-joined, in the order specified)
for several.
IncludeTagUnclosed(String)
A tagged region in an include file was opened by a tag:: directive but
never closed. The field is the unclosed tag name.
IncludeTagMismatchedEnd(String, String)
An end:: tag directive in an include file names a different tag than
the region currently open. The first field is the expected (open) tag,
the second is the tag actually found.
IncludeTagUnexpectedEnd(String)
An end:: tag directive in an include file was found with no
corresponding open region. The field is the unexpected tag name.
AbstractBlockInBookWithoutDoctitle
An [abstract] block was found as a direct child of a document without
a doctitle when the doctype is book. Asciidoctor excludes such a
block’s content from the converted output.
PossibleInvalidReference(String)
A cross-reference (<<id>> or xref:id[…]) named a target that the
resolution pass could not resolve. The reference still renders as the
unresolved fallback link (<a href="#id">[id]</a>). The field is the
target exactly as written in the source.
Asciidoctor reports this only in verbose (pedantic) mode, since a reference to an anchor that is not stored in the parse tree can be a false positive.
UnsafeLinkSchemeRejected(String)
An explicit link: macro named a target whose URI scheme can execute
script (javascript:, data:, or vbscript:). The macro is not turned
into a link; it is left as literal source text instead. The field is the
target exactly as written. This is a security measure with no
counterpart in Ruby Asciidoctor.
Trait Implementations§
Source§impl Clone for WarningType
impl Clone for WarningType
Source§fn clone(&self) -> WarningType
fn clone(&self) -> WarningType
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 WarningType
impl Debug for WarningType
Source§impl Display for WarningType
impl Display for WarningType
impl Eq for WarningType
Source§impl Error for WarningType
impl Error for WarningType
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()