n0_snafu

Enum Error

Source
pub enum Error {
    Source {
        source: Box<dyn Formatted + Sync + Send + 'static>,
        span_trace: SpanTrace,
        backtrace: Option<Backtrace>,
    },
    Message {
        message: Option<String>,
        span_trace: SpanTrace,
        source: Box<dyn Error + Sync + Send + 'static>,
        backtrace: Option<Backtrace>,
    },
    Anyhow {
        source: Error,
        span_trace: SpanTrace,
        backtrace: Option<Backtrace>,
    },
    Whatever {
        message: Option<String>,
        span_trace: SpanTrace,
        source: Option<Box<Error>>,
        backtrace: Option<Backtrace>,
    },
}

Variants§

§

Source

Fields

§source: Box<dyn Formatted + Sync + Send + 'static>
§span_trace: SpanTrace
§backtrace: Option<Backtrace>
§

Message

Fields

§message: Option<String>
§span_trace: SpanTrace
§source: Box<dyn Error + Sync + Send + 'static>
§backtrace: Option<Backtrace>
§

Anyhow

Fields

§source: Error
§span_trace: SpanTrace
§backtrace: Option<Backtrace>
§

Whatever

Fields

§message: Option<String>
§span_trace: SpanTrace
§source: Option<Box<Error>>
§backtrace: Option<Backtrace>

Implementations§

Source§

impl Error

Source

pub fn span_trace(&self) -> &SpanTrace

Source

pub fn backtrace(&self) -> Option<Backtrace<'_>>

Source

pub fn anyhow(err: Error) -> Self

Source

pub fn stack(&self) -> Vec<(Option<Backtrace<'_>>, Source<'_>)>

Trait Implementations§

Source§

impl Debug for Error

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

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

Formats the value using the given formatter. Read more
Source§

impl ErrorCompat for Error

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
Source§

impl<E1: Formatted + Send + Sync + 'static> From<E1> for Error

Source§

fn from(value: E1) -> Self

Converts to this type from the input type.
Source§

impl FromString for Error

Source§

type Source = Error

The underlying error
Source§

fn without_source(message: String) -> Self

Create a brand new error from the given string
Source§

fn with_source(source: Error, message: String) -> Self

Wrap an existing error with the given string

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more