Skip to main content

WarningKind

Enum WarningKind 

Source
#[non_exhaustive]
pub enum WarningKind {
Show 17 variants SectionLevelOutOfSequence { expected: u8, got: u8, }, NestedSectionInBibliography, NestedSectionInIndex, UnterminatedTable { delimiter: String, }, UnterminatedDelimitedBlock { kind: &'static str, delimiter: String, }, TableUnknownFormat { format: String, }, TableIncompleteRow, TableCellOverflow { actual: usize, expected: usize, }, TableColumnCount { actual: usize, expected: usize, occupied_from_rowspans: usize, }, NonStandardAuthorLine { line: String, }, UnresolvedReference { target: String, }, DuplicateId { id: String, first: Box<SourceLocation>, }, ConflictingFootnote { id: String, first: Box<SourceLocation>, }, LegacyFloatDiscreteHeading, InvalidDocumentAttribute { name: String, value: String, expected: &'static str, }, ContentRecovery { message: Cow<'static, str>, }, Other(Cow<'static, str>),
}
Expand description

Categorised non-fatal conditions.

Other is an escape hatch for ad-hoc messages the parser has not yet been taught to categorise. New variants should be added as callers need to assert on them programmatically (e.g. LSP mapping kind to LSP diagnostic codes, or tests matching on specific conditions without resorting to string comparison).

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.
§

SectionLevelOutOfSequence

A section title skips a level relative to its parent — either the first section after the document title is deeper than level 1, or a nested section jumps more than one level below its parent. Matches asciidoctor’s “section title out of sequence” check; the section is still rendered at its literal level.

Fields

§expected: u8

The level the section was expected to be (one deeper than its parent; 1 for the first section under a document title).

§got: u8

The observed section level (e.g. 2 for ===).

§

NestedSectionInBibliography

A bibliography section contains a direct child section. The child is retained in the document, matching Asciidoctor’s recovery behavior.

§

NestedSectionInIndex

An index contains a direct child section. The child remains in the AST; each converter applies its usual index-content policy.

§

UnterminatedTable

A table’s opening delimiter was matched but no corresponding closing delimiter was found before end of input. Matches asciidoctor’s “unterminated table block” warning.

delimiter is the literal opening token as it appeared in the source (e.g. "|===", "!=====").

Fields

§delimiter: String

The opening delimiter that was left unmatched.

§

UnterminatedDelimitedBlock

A delimited block’s opening delimiter was matched but no corresponding closing delimiter was found before end of input. Matches asciidoctor’s “unterminated block” warning; the block is still rendered, closed at end of input. Tables use the separate UnterminatedTable variant.

delimiter is the literal opening token as it appeared in the source (e.g. "====", "----").

Fields

§kind: &'static str

The block kind: "example", "listing", "literal", "sidebar", "quote", "open", "comment", or "pass".

§delimiter: String

The opening delimiter that was left unmatched.

§

TableUnknownFormat

A table declared an unsupported format attribute, so the parser fell back to the table delimiter’s default separator.

Fields

§format: String

The unsupported format value.

§

TableIncompleteRow

A table ended with cells that could not fill a complete row, so those trailing cells were dropped.

§

TableCellOverflow

A table row contained a cell/span that exceeded the configured column count, so the row was dropped.

Fields

§actual: usize

The row’s logical column count.

§expected: usize

The configured column count.

§

TableColumnCount

A table row’s logical column count did not match the configured column count, so the row was dropped.

Fields

§actual: usize

The row’s logical column count.

§expected: usize

The configured column count.

§occupied_from_rowspans: usize

Columns already occupied by active rowspans.

§

NonStandardAuthorLine

A document header author line did not match the structured firstname [middlename] [lastname] [<email>] form, so the whole line was kept as a single author’s name. asciidoctor accepts this silently; acdc surfaces it so a malformed author line is easy to spot.

Fields

§line: String

The author line as parsed (after attribute substitution).

§

UnresolvedReference

A cross-reference (<<id>> / xref:id[]) points at an id that is not defined anywhere in the document. Matches asciidoctor’s “invalid reference” warning.

Fields

§target: String

The unresolved target id.

§

DuplicateId

More than one source definition uses the same ID. References keep the first.

Fields

§id: String

The original, unencoded ID.

§first: Box<SourceLocation>

The first definition, including its original file and position.

§

ConflictingFootnote

A named footnote is repeated with different text. The first body is retained.

Fields

§id: String

The repeated footnote ID.

§first: Box<SourceLocation>

The first definition, including its original file and position.

§

LegacyFloatDiscreteHeading

A discrete heading was marked with the legacy float attribute rather than discrete. float is only supported because an older version of AsciiDoc called discrete headings “floating titles”; the current spec prefers discrete.

§

InvalidDocumentAttribute

A document attribute value did not match its documented domain. The previous effective value remains active.

Fields

§name: String

Document attribute name.

§value: String

Value as supplied by the document.

§expected: &'static str

Short description of the registered value domain.

§

ContentRecovery

Requested source content or substitutions were omitted, replaced, or recovered.

Rendering can continue, but consumers that require complete source content must handle this condition before using the recovered document.

Fields

§message: Cow<'static, str>

The recovery and the source content it affected.

§

Other(Cow<'static, str>)

Ad-hoc message not yet categorised into a typed variant.

Trait Implementations§

Source§

impl Clone for WarningKind

Source§

fn clone(&self) -> Self

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 WarningKind

Source§

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

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

impl Display for WarningKind

Source§

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

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

impl Error for WarningKind

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 PartialEq for WarningKind

Source§

fn eq(&self, other: &Self) -> 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 WarningKind

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more