Skip to main content

ErrorKind

Enum ErrorKind 

Source
#[non_exhaustive]
pub enum ErrorKind { Missing, Mismatch { expected: Cow<'static, str>, found: String, }, Invalid(String), UnknownKey { suggestion: Option<String>, }, UnknownVariant { found: String, expected: &'static [&'static str], }, Syntax { format: &'static str, message: String, }, Unsupported(String), Io { path: PathBuf, source: Error, }, Cli(String), Help(String), Multiple(Vec<ConfigError>), }
Expand description

What went wrong.

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

Missing

A required value is absent.

§

Mismatch

A value cannot be converted into the expected type.

Fields

§expected: Cow<'static, str>

Type label of the target.

§found: String

The offending text.

§

Invalid(String)

A validator rejected the value.

§

UnknownKey

A key that no field declares.

Fields

§suggestion: Option<String>

Closest declared key, when one is similar enough.

§

UnknownVariant

An enum value that matches no variant.

Fields

§found: String

The offending text.

§expected: &'static [&'static str]

Every accepted variant key.

§

Syntax

The input is not valid in its format.

Fields

§format: &'static str

Format label such as toml.

§message: String

Parser message.

§

Unsupported(String)

A feature or format that is unavailable.

§

Io

A file could not be read.

Fields

§path: PathBuf

The file that failed.

§source: Error

The underlying error.

§

Cli(String)

Bad command-line input.

§

Help(String)

The user asked for the help text.

§

Multiple(Vec<ConfigError>)

Several independent errors.

Trait Implementations§

Source§

impl Debug for ErrorKind

Source§

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

Formats the value using the given formatter. Read more

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