Skip to main content

LoadErrorKind

Enum LoadErrorKind 

Source
#[non_exhaustive]
pub enum LoadErrorKind {
Show 15 variants Unreadable { path: PathBuf, message: String, }, NotASchema, BothMarkers, SpecUnknown { spelling: String, }, Missing { key: String, }, EntryIsBoth, NotText { key: String, spelling: String, }, NotAMapping { spelling: String, }, NotAList { spelling: String, }, PatternUnreadable { text: String, error: PatternError, }, UnknownType { name: String, suggestion: Option<&'static str>, }, UnknownSeverity { spelling: String, }, FromAndInline, NotAVocabulary { path: PathBuf, }, Cycle { chain: Vec<PathBuf>, },
}
Expand description

The kind of a LoadError.

#[non_exhaustive]: the loader learns to refuse more as the format grows, so a match needs a _ 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.
§

Unreadable

The reader could not produce a document: the file is missing, is not a format it reads, or does not parse. The message is the reader’s.

Fields

§path: PathBuf

The path that could not be read, as resolved.

§message: String

What the reader said.

§

NotASchema

Neither a schema nor a vocabulary key at the top level, so this is neither a schema document nor a vocabulary document.

§

BothMarkers

Both a schema and a vocabulary key, which the format refuses rather than guessing which the author meant.

§

SpecUnknown

schema.spec is a version of the format this crate does not read.

Fields

§spelling: String

The spec as written.

§

Missing

A key the format requires is missing — spec, at, kind, message, field.

Fields

§key: String

Which key.

§

EntryIsBoth

An entry in rules that has both at and include.

§

NotText

A value that has to be text and is not — an at, an include, a type, a kind, a from, a message.

Fields

§key: String

Which key.

§spelling: String

How it was written.

§

NotAMapping

A value that has to be a mapping and is not — rules[i], schema, constraint, an on_change entry.

Fields

§spelling: String

How it was written.

§

NotAList

rules is not a list.

Fields

§spelling: String

How it was written.

§

PatternUnreadable

An at (or a vocabulary document’s field) the pattern grammar cannot read.

Fields

§text: String

The text as written.

§error: PatternError

Why not.

§

UnknownType

A type naming no type the format defines.

Fields

§name: String

The name as written.

§suggestion: Option<&'static str>

The name most likely meant, if one is close.

§

UnknownSeverity

A severity naming none of notice, confirm, confirm_explicitly.

Fields

§spelling: String

How it was written.

§

FromAndInline

A vocabulary constraint with both from and inline values/terms.

§

NotAVocabulary

A from whose document is not a vocabulary document.

Fields

§path: PathBuf

The document from named, as resolved.

§

Cycle

An include that reaches a document already being loaded.

Fields

§chain: Vec<PathBuf>

The documents in the cycle, in include order, the repeated one last.

Trait Implementations§

Source§

impl Clone for LoadErrorKind

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 LoadErrorKind

Source§

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

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

impl Display for LoadErrorKind

Source§

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

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

impl PartialEq for LoadErrorKind

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 LoadErrorKind

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 = !

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.