Trait Error

Source
pub trait Error: Debug + Display {
    type R;
    type Category: Category<R = Self::R>;
    type Kind: Kind<R = Self::R, Category = Self::Category>;

    // Required method
    fn kind(&self) -> Self::Kind;

    // Provided methods
    fn category(&self) -> Self::Category { ... }
    fn location(&self) -> Location { ... }
}
Expand description

The trait of error types.

See the crate documentation for more information.

Required Associated Types§

Source

type R

The underlying Rust type of error kind.

A concrete builtin type, e.g., u8.

Source

type Category: Category<R = Self::R>

The error category concrete type.

Source

type Kind: Kind<R = Self::R, Category = Self::Category>

The error kind concrete type.

Required Methods§

Source

fn kind(&self) -> Self::Kind

Returns the error kind.

The error kind is unique per tighterror::Error instantiation.

Provided Methods§

Source

fn category(&self) -> Self::Category

Returns the error category.

This method is a shorthand for self.kind().category().

Source

fn location(&self) -> Location

Returns the error’s source location.

By default an undefined location is returned, unless the concrete error type supports it and the error instance is initialized with it.

Implementors§