[][src]Enum problem::Problem

pub enum Problem {
    Cause(CauseOption<String>),
    Context(StringBox<Problem>),
}

Error type that is not supposed to be handled but reported, panicked on or ignored

Variants

Cause(CauseOption<String>)Context(StringBox<Problem>)

Methods

impl Problem[src]

pub fn from_message(
    msg: impl ToString
) -> Problem
[src]

Create Problem from any type implementing ToString or Display

pub fn from_error<E>(error: E) -> Problem where
    E: Into<Box<dyn Error>>, 
[src]

Create Problem from types implementing Error so that Error::cause chain is followed through in the Display message

pub fn from_error_message<E>(error: &E) -> Problem where
    E: Error
[src]

Same as Problem::from_error but stores only final message and does not take ownership of the error

pub fn while_context(
    self,
    msg: impl ToString
) -> Problem
[src]

Add context information to this Problem instance

pub fn backtrace(&self) -> Option<&str>[src]

Get backtrace associated with this Problem instance if available

Trait Implementations

impl<E> From<E> for Problem where
    E: Into<Box<dyn Error>>, 
[src]

Every type implementing Error trait can implicitly be converted to Problem via ? operator

impl Debug for Problem[src]

impl Display for Problem[src]

Auto Trait Implementations

impl !Send for Problem

impl !Sync for Problem

Blanket Implementations

impl<T> ToProblem for T where
    T: ToString
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]