jiff::error

Enum ErrorKind

Source
enum ErrorKind {
    Adhoc(AdhocError),
    Range(RangeError),
    Shared(Error),
    FilePath(FilePathError),
    IO(IOError),
}
Expand description

The underlying kind of a Error.

Variants§

§

Adhoc(AdhocError)

An ad hoc error that is constructed from anything that implements the core::fmt::Display trait.

In theory we try to avoid these, but they tend to be awfully convenient. In practice, we use them a lot, and only use a structured representation when a lot of different error cases fit neatly into a structure (like range errors).

§

Range(RangeError)

An error that occurs when a number is not within its allowed range.

This can occur directly as a result of a number provided by the caller of a public API, or as a result of an operation on a number that results in it being out of range.

§

Shared(Error)

An error that occurs within jiff::shared.

It has its own error type to avoid bringing in this much bigger error type.

§

FilePath(FilePathError)

An error associated with a file path.

This is generally expected to always have a cause attached to it explaining what went wrong. The error variant is just a path to make it composable with other error types.

The cause is typically Adhoc or IO.

When std is not enabled, this variant can never be constructed.

§

IO(IOError)

An error that occurs when interacting with the file system.

This is effectively a wrapper around std::io::Error coupled with a std::path::PathBuf.

When std is not enabled, this variant can never be constructed.

Trait Implementations§

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

Source§

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

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

impl From<ErrorKind> for Error

Source§

fn from(kind: ErrorKind) -> Error

Converts to this type from the input type.

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