Type Alias Error

Source
pub type Error = StackedError;

Aliased Type§

pub struct Error { /* private fields */ }

Implementations§

Source§

impl Error

Note: in most cases you can use Error::from or a call from StackableErr instead of these functions.

Source

pub fn empty() -> Self

Returns an empty error stack

Source

pub fn new() -> Self

Returns an error stack with just a UnitError and location information

Source

pub fn from_err<E: Display + Send + Sync + 'static>(e: E) -> Self

Source

pub fn from_err_locationless<E: Display + Send + Sync + 'static>(e: E) -> Self

Source

pub fn push(&mut self)

Only pushes track_caller location to the stack

Source

pub fn add(self) -> Self

Only adds track_caller location to the stack

Source

pub fn push_err<E: Display + Send + Sync + 'static>(&mut self, e: E)

Pushes error e with location to the stack

Source

pub fn add_err<E: Display + Send + Sync + 'static>(self, e: E) -> Self

Adds error e with location to the stack

Source

pub fn push_err_locationless<E: Display + Send + Sync + 'static>( &mut self, e: E, )

Pushes error e without location information to the stack

Source

pub fn add_err_locationless<E: Display + Send + Sync + 'static>( self, e: E, ) -> Self

Adds error e without location information to the stack

Source

pub fn chain_errors(self, other: Self) -> Self

Moves the stack of other onto self

Source

pub fn timeout() -> Self

Returns a base TimeoutError error

Source

pub fn probably_not_root_cause() -> Self

Returns a base ProbablyNotRootCauseError error

Source

pub fn is_timeout(&self) -> bool

Returns if a TimeoutError is in the error stack

Source

pub fn is_probably_not_root_cause(&self) -> bool

Returns if a ProbablyNotRootCauseError is in the error stack

Source

pub fn iter(&self) -> Iter<'_, ErrorItem>

Iteration over the StackedErrorDowncast items of self

Source

pub fn iter_mut(&mut self) -> IterMut<'_, ErrorItem>

Mutable iteration over the StackedErrorDowncast items of self

Trait Implementations§

Source§

impl Debug for Error

Source§

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

Has terminal styling

Source§

impl Default for Error

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Error

Source§

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

Same as Debug but without terminal styling

Source§

impl Error for Error

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl<'a> IntoIterator for &'a Error

Source§

type IntoIter = Iter<'a, ErrorItem>

Which kind of iterator are we turning this into?
Source§

type Item = &'a ErrorItem

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> IntoIterator for &'a mut Error

Source§

type IntoIter = IterMut<'a, ErrorItem>

Which kind of iterator are we turning this into?
Source§

type Item = &'a mut ErrorItem

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl StackableErr for Error

Source§

type Output = Result<(), StackedError>

Source§

fn stack(self) -> Self::Output

Pushes just location information to the error stack
Source§

fn stack_locationless(self) -> Self::Output

Only converts to Self::Output and pushes it on the error stack
Source§

fn stack_err<E1: Display + Send + Sync + 'static>(self, e: E1) -> Self::Output

Pushes the result of f and location information to the error stack
Source§

fn stack_err_with<E1: Display + Send + Sync + 'static, F: FnOnce() -> E1>( self, f: F, ) -> Self::Output

Pushes e and location information to the error stack
Source§

fn stack_err_locationless<E1: Display + Send + Sync + 'static>( self, e: E1, ) -> Self::Output

Pushes e without location information to the error stack
Source§

fn stack_err_with_locationless<E1: Display + Send + Sync + 'static, F: FnOnce() -> E1>( self, f: F, ) -> Self::Output

Pushes the result of f without location information to the error stack
Source§

fn wrap_err<D: Display + Send + Sync + 'static>(self, msg: D) -> Self::Output

Alternate for StackableErr::stack_err which can be used for easier translation to and from the eyre crate
Source§

fn wrap_err_with<D: Display + Send + Sync + 'static, F: FnOnce() -> D>( self, msg: F, ) -> Self::Output

Alternate for StackableErr::stack_err_with which can be used for easier translation to and from the eyre crate
Source§

fn context<D: Display + Send + Sync + 'static>(self, msg: D) -> Self::Output

Alternate for StackableErr::stack_err which can be used for easier translation to and from the anyhow crate
Source§

fn with_context<D: Display + Send + Sync + 'static, F: FnOnce() -> D>( self, msg: F, ) -> Self::Output

Alternate for StackableErr::stack_err_with which can be used for easier translation to and from the anyhow crate