pub struct Problem { /* private fields */ }Expand description
Wraps error, context and backtrace information and formats it for display. Data is heap allocated to avoid type parameters or lifetimes.
Implementations§
Source§impl Problem
impl Problem
Sourcepub fn from_error(error: impl Into<Box<dyn Error>>) -> Problem
pub fn from_error(error: impl Into<Box<dyn Error>>) -> Problem
Create Problem from types implementing Into<Box<dyn Error>> (including String and &str) so that Error::cause
chain is followed through in the Display message
Sourcepub fn from_error_message(error: &impl Error) -> Problem
pub fn from_error_message(error: &impl Error) -> Problem
Same as Problem::from_error but stores only final message as String and does not take ownership of the error
Sourcepub fn backtrace(&self) -> Option<&str>
pub fn backtrace(&self) -> Option<&str>
Get backtrace associated with this Problem instance if available
Sourcepub fn into_error(self) -> Error
pub fn into_error(self) -> Error
Wraps Problem into type implementing Error trait
Trait Implementations§
Source§impl<E> From<E> for Problem
Every type implementing Into<Box<dyn Error>> trait (including String and &str types) can be converted to Problem via ? operator
impl<E> From<E> for Problem
Every type implementing Into<Box<dyn Error>> trait (including String and &str types) can be converted to Problem via ? operator
Source§impl From<Problem> for FatalProblem
impl From<Problem> for FatalProblem
Source§fn from(problem: Problem) -> FatalProblem
fn from(problem: Problem) -> FatalProblem
Converts to this type from the input type.
Source§impl ProblemWhile for Problem
impl ProblemWhile for Problem
type WithContext = Problem
Source§fn problem_while(self, message: impl ToString) -> Problem
fn problem_while(self, message: impl ToString) -> Problem
Add context information
Auto Trait Implementations§
impl Freeze for Problem
impl !RefUnwindSafe for Problem
impl !Send for Problem
impl !Sync for Problem
impl Unpin for Problem
impl !UnwindSafe for Problem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more