Skip to main content

ErrorKind

Enum ErrorKind 

Source
#[non_exhaustive]
pub enum ErrorKind {
Show 91 variants TooManyComments, InputIo { error: InputIoError, }, InputDecoding { message: String, }, InputByteLimitExceeded { limit: usize, }, UnexpectedEofFlowSequence, UnexpectedEofFlowMapping, UnexpectedEofImplicitFlowMapping, UnexpectedEofBlockSequence, UnexpectedEofBlockMapping, UnexpectedEof, ExpectedStreamStart, DuplicateVersionDirective, UnsupportedYamlMajorVersion, DuplicateTagDirective, ExpectedDocumentStart, MissingDocumentEndBeforeDirective, AnchorCountOverflow, UnknownAnchor, ExpectedNodeContent, ExpectedBlockMappingKey, ExpectedFlowMappingSeparator, ExpectedFlowSequenceSeparator, ExpectedBlockSequenceEntry, UndeclaredTagHandle, MissingIncludeResolver, Custom(String), MultipleDocumentsUnsupported, InputOffsetsWithoutSlice, InputSlicingUnavailable, ExpectedTagBang, ExpectedTagDirectiveBang, InvalidGlobalTagCharacter, SimpleKeyExpected, InvalidSimpleKey, InvalidDocumentEnd, InvalidIndentation, BomInsideDocument, UnexpectedCharacter { character: char, }, TabNotAllowed, TabInBlockIndentation, CommentInterceptedScalar, ExpectedWhitespace, CommentNotSeparated, InvalidDirectiveTerminator, MissingYamlVersionSeparator, MissingDirectiveName, InvalidDirectiveName, YamlVersionTooLong, MissingYamlVersion, InvalidTagDirectiveTerminator, InvalidTagTerminator, MissingTagUri, UnclosedVerbatimTag, InvalidTagEscape, InvalidTagUtf8LeadingByte, InvalidTagUtf8TrailingByte, InvalidTagUtf8, MissingAnchorOrAliasName, MisplacedFlowCollectionEnd, MismatchedFlowCollectionEnd { open: char, close: char, }, UnclosedFlowCollection { open: char, }, RecursionLimitExceeded, BlockEntryInFlowCollection, BlockSequenceEntryNotAllowed, InvalidBlockEntryWhitespace, ZeroBlockScalarIndent, InvalidBlockScalarHeader, TabAtBlockScalarStart, InvalidBlockScalarIndent, DocumentIndicatorInQuotedScalar, UnclosedQuotedScalar, TabInIndentation, InvalidQuotedScalarIndent, InvalidTrailingSingleQuotedScalar, InvalidTrailingDoubleQuotedScalar, UnknownQuotedScalarEscape, InvalidQuotedScalarHexEscape, InvalidLowSurrogateHexEscape, InvalidLowSurrogate, MissingLowSurrogate, UnpairedLowSurrogate, InvalidUnicodeEscape, InvalidFlowScalarIndent, PlainScalarStartsWithDashFlowIndicator, TabInPlainScalar, UnexpectedEndOfPlainScalar, MappingKeyNotAllowed, FlowMappingValueAdjacentCollection, InvalidMappingValueWhitespace, InvalidColonPlacement, MappingValueNotAllowed,
}
Expand description

Machine-readable category for a ScanError.

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

TooManyComments

Too many consecutive comments were buffered before a collection entry.

§

InputIo

Reading from the input source failed.

Fields

§error: InputIoError

Portable details and, with the std feature, an optional retained I/O error.

§

InputDecoding

The input source was not valid text in the adapter’s expected encoding.

Fields

§message: String

Human-readable details supplied by the input adapter.

§

InputByteLimitExceeded

The raw input exceeded a configured byte limit.

Fields

§limit: usize

Maximum number of raw input bytes accepted by the adapter.

§

UnexpectedEofFlowSequence

Input ended while parsing a flow sequence.

§

UnexpectedEofFlowMapping

Input ended while parsing a flow mapping.

§

UnexpectedEofImplicitFlowMapping

Input ended while parsing an implicit flow mapping.

§

UnexpectedEofBlockSequence

Input ended while parsing a block sequence.

§

UnexpectedEofBlockMapping

Input ended while parsing a block mapping.

§

UnexpectedEof

Input ended unexpectedly in another parser state.

§

ExpectedStreamStart

A stream-start token was expected.

§

DuplicateVersionDirective

More than one YAML version directive was found for a document.

§

UnsupportedYamlMajorVersion

The YAML major version is unsupported.

§

DuplicateTagDirective

A tag directive handle was declared more than once for a document.

§

ExpectedDocumentStart

A document-start token was expected.

§

MissingDocumentEndBeforeDirective

A directive followed an implicit document without an explicit document end.

§

AnchorCountOverflow

The parser ran out of representable anchor identifiers.

§

UnknownAnchor

An alias referred to an unknown anchor.

§

ExpectedNodeContent

The parser did not find expected node content.

§

ExpectedBlockMappingKey

A block mapping key was expected.

§

ExpectedFlowMappingSeparator

A flow mapping separator or closing brace was expected.

§

ExpectedFlowSequenceSeparator

A flow sequence separator or closing bracket was expected.

§

ExpectedBlockSequenceEntry

A block sequence entry indicator was expected.

§

UndeclaredTagHandle

A tag used a handle that was not declared.

§

MissingIncludeResolver

No include resolver was configured for a parser stack.

§

Custom(String)

An error supplied by an external parser adapter or resolver.

§

MultipleDocumentsUnsupported

A parser-stack entry contained multiple documents where only one is supported.

§

InputOffsetsWithoutSlice

An input advertised byte offsets but did not provide the requested slice.

§

InputSlicingUnavailable

An input advertised slicing but did not provide the requested slice.

§

ExpectedTagBang

A tag did not begin with the expected exclamation mark.

§

ExpectedTagDirectiveBang

A tag directive handle did not end with the expected exclamation mark.

§

InvalidGlobalTagCharacter

A global tag started with an invalid character.

§

SimpleKeyExpected

A required simple key was not followed by a value indicator.

§

InvalidSimpleKey

A previously saved simple key was no longer valid.

§

InvalidDocumentEnd

Invalid content followed a document-end marker.

§

InvalidIndentation

Indentation was invalid for the current parser context.

§

BomInsideDocument

A byte-order mark appeared inside a document.

§

UnexpectedCharacter

An unexpected reserved character was encountered.

Fields

§character: char

The character that was encountered.

§

TabNotAllowed

A tab was used in a context where it is not allowed.

§

TabInBlockIndentation

A tab was used in block indentation.

§

CommentInterceptedScalar

A comment interrupted a multiline plain scalar.

§

ExpectedWhitespace

Required whitespace was not found.

§

CommentNotSeparated

A comment was not separated from the preceding token by whitespace.

§

InvalidDirectiveTerminator

A directive did not end with a comment or line break.

§

MissingYamlVersionSeparator

A YAML version directive did not contain the expected digit or dot.

§

MissingDirectiveName

A directive name was missing.

§

InvalidDirectiveName

A directive name contained an invalid character.

§

YamlVersionTooLong

A YAML version component exceeded the supported length.

§

MissingYamlVersion

A YAML version component was missing.

§

InvalidTagDirectiveTerminator

A tag directive did not end with whitespace or a line break.

§

InvalidTagTerminator

A tag token did not end with valid separation whitespace.

§

MissingTagUri

A tag URI was missing.

§

UnclosedVerbatimTag

A verbatim tag was missing its closing angle bracket.

§

InvalidTagEscape

A tag contained an invalid percent escape.

§

InvalidTagUtf8LeadingByte

A tag escape started with an invalid UTF-8 byte.

§

InvalidTagUtf8TrailingByte

A tag escape contained an invalid trailing UTF-8 byte.

§

InvalidTagUtf8

A tag escape did not decode to one valid Unicode scalar value.

§

MissingAnchorOrAliasName

An anchor or alias name was missing.

§

MisplacedFlowCollectionEnd

A flow collection closing bracket was misplaced.

§

MismatchedFlowCollectionEnd

A flow collection was closed with the wrong bracket type.

Fields

§open: char

The bracket that opened the flow collection.

§close: char

The bracket that closed the flow collection.

§

UnclosedFlowCollection

A flow collection was not closed.

Fields

§open: char

The bracket that opened the flow collection.

§

RecursionLimitExceeded

The supported flow nesting limit was exceeded.

§

BlockEntryInFlowCollection

A block entry indicator appeared inside a flow collection.

§

BlockSequenceEntryNotAllowed

A block sequence entry appeared in a context that does not allow it.

§

InvalidBlockEntryWhitespace

A block entry indicator was followed by invalid whitespace.

§

ZeroBlockScalarIndent

A block scalar used an indentation indicator of zero.

§

InvalidBlockScalarHeader

A block scalar header did not end with a comment or line break.

§

TabAtBlockScalarStart

Block scalar content began with a tab.

§

InvalidBlockScalarIndent

A block scalar content line had invalid indentation.

§

DocumentIndicatorInQuotedScalar

A document indicator appeared inside a quoted scalar.

§

UnclosedQuotedScalar

A quoted scalar was not closed.

§

TabInIndentation

A tab was used as indentation.

§

InvalidQuotedScalarIndent

A multiline quoted scalar had invalid indentation.

§

InvalidTrailingSingleQuotedScalar

Invalid content followed a single-quoted scalar.

§

InvalidTrailingDoubleQuotedScalar

Invalid content followed a double-quoted scalar.

§

UnknownQuotedScalarEscape

A quoted scalar contained an unknown escape character.

§

InvalidQuotedScalarHexEscape

A quoted scalar escape did not contain the expected hexadecimal digits.

§

InvalidLowSurrogateHexEscape

A low-surrogate escape did not contain the expected hexadecimal digits.

§

InvalidLowSurrogate

A surrogate pair contained an invalid low surrogate.

§

MissingLowSurrogate

A high surrogate was not followed by a low surrogate.

§

UnpairedLowSurrogate

A low surrogate appeared without a preceding high surrogate.

§

InvalidUnicodeEscape

A quoted scalar escape did not represent a valid Unicode scalar value.

§

InvalidFlowScalarIndent

A flow scalar started at invalid indentation.

§

PlainScalarStartsWithDashFlowIndicator

A plain scalar began with a dash followed by a flow indicator.

§

TabInPlainScalar

A tab appeared where a plain scalar could not accept it.

§

UnexpectedEndOfPlainScalar

A plain scalar ended before consuming any content.

§

MappingKeyNotAllowed

A mapping key appeared in a context that does not allow one.

§

FlowMappingValueAdjacentCollection

A flow mapping value indicator was adjacent to a collection start.

§

InvalidMappingValueWhitespace

A mapping value indicator was followed by invalid whitespace.

§

InvalidColonPlacement

A value indicator was placed illegally in an implicit flow mapping.

§

MappingValueNotAllowed

A mapping value appeared in a context that does not allow one.

Trait Implementations§

Source§

impl Clone for ErrorKind

Source§

fn clone(&self) -> ErrorKind

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 ErrorKind

Source§

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

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

impl Display for ErrorKind

Available on crate feature error_messages only.
Source§

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

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

impl Eq for ErrorKind

Source§

impl Hash for ErrorKind

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 ErrorKind

Source§

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

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.