[][src]Struct sval::stream::Source

pub struct Source<'a> { /* fields omitted */ }

A streamable error.

This type shouldn't be confused with sval::Error, which is used to communicate errors back to callers. The purpose of the Source type is to let streams serialize error types, that may have backtraces and other metadata.

Sources can only be created when the std feature is available, but streams can still work with them by formatting them or passing them along even in no-std environments where the Error trait isn't available.

Implementations

impl<'a> Source<'a>[src]

pub fn new(err: &'a impl Error) -> Self[src]

Capture an error source from a standard error.

This method is only available when the std feature is enabled.

pub fn get<'b>(&'b self) -> impl Error + 'b[src]

Get the inner error.

Trait Implementations

impl<'a> AsRef<dyn Error + 'static> for Source<'a>[src]

impl<'a> Debug for Source<'a>[src]

impl<'a> Display for Source<'a>[src]

impl<'a> From<&'a (dyn Error + 'a)> for Source<'a>[src]

impl<'a> Value for Source<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Source<'a>

impl<'a> !Send for Source<'a>

impl<'a> !Sync for Source<'a>

impl<'a> Unpin for Source<'a>

impl<'a> !UnwindSafe for Source<'a>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.