[−][src]Struct cotton::prelude::Problem
Wraps error, context and backtrace information and formats it for display. Data is heap allocated to avoid type parameters or lifetimes.
Methods
impl Problem
[src]
pub fn from_error<impl Into>>(
error: impl Into>
) -> Problem where
impl Into>: Into<Box<dyn Error + 'static>>,
[src]
error: impl Into
) -> Problem where
impl Into
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
pub fn from_error_message<impl Error>(error: &impl Error) -> Problem where
impl Error: Error,
[src]
impl Error: Error,
Same as Problem::from_error
but stores only final message as String
and does not take ownership of the error
pub fn backtrace(&self) -> Option<&str>
[src]
Get backtrace associated with this Problem
instance if available
Trait Implementations
impl ProblemWhile for Problem
[src]
type WithContext = Problem
fn problem_while<impl ToString>(self, message: impl ToString) -> Problem where
impl ToString: ToString,
[src]
impl ToString: ToString,
fn problem_while_with<F, M>(self, message: F) -> Problem where
F: FnOnce() -> M,
M: ToString,
[src]
F: FnOnce() -> M,
M: ToString,
impl Display for Problem
[src]
impl Debug for Problem
[src]
impl<E> From<E> for Problem where
E: Into<Box<dyn Error + 'static>>,
[src]
E: Into<Box<dyn Error + 'static>>,
Every type implementing Into<Box<dyn Error>>
trait (including String
and &str
types) can be converted to Problem
via ?
operator
Auto Trait Implementations
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
ⓘImportant traits for &'_ mut Rfn borrow_mut(&mut self) -> &mut T
[src]
ⓘImportant traits for &'_ mut R
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,