Skip to main content

WarningType

Enum WarningType 

Source
#[non_exhaustive]
pub enum WarningType {
Show 53 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), SpecialSectionCannotHaveNestedSections(String), 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), IncludeFileNotReadable(String), IncludeFileNotDecodable(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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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.

§

SpecialSectionCannotHaveNestedSections(String)

A special section that does not support nested sections (a glossary, bibliography, colophon, dedication, or index section) contains a subsection. The field is the section’s style name. Mirrors Asciidoctor, which permits subsections only within the appendix, preface, and abstract special sections.

§

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.

§

IncludeFileNotReadable(String)

An include:: directive named a file that exists but the configured include file handler could not read (for example a permission or other IO error). The field is the target as written. Asciidoctor distinguishes this from IncludeFileNotFound, logging include file not readable rather than include file not found.

§

IncludeFileNotDecodable(String)

An include:: directive named a file that the configured include file handler found and read but which is not valid UTF-8, and which the handler could not transcode (no encoding attribute, or one it does not support). The field is the target as written. Asciidoctor treats this as a fatal error (invalid byte sequence in UTF-8) that aborts the conversion; this crate favors recoverable warnings, so it drops the include and records this warning instead. This is distinct from NonUtf8IncludeEncoding, which reports an unsupported encoding request for content the handler did return.

§

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

Source§

fn clone(&self) -> WarningType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WarningType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for WarningType

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for WarningType

Source§

impl Error for WarningType

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl Hash for WarningType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for WarningType

Source§

fn eq(&self, other: &WarningType) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WarningType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.