pub struct Exn<E: Error> { /* private fields */ }Expand description
An exception type that can hold an error tree and additional context.
Implementations§
Source§impl<E: Error> Exn<E>
impl<E: Error> Exn<E>
Sourcepub fn new(error: E) -> Self
pub fn new(error: E) -> Self
Create a new exception with the given error.
This will automatically walk the source chain of the error and add them as children frames.
See also Error::raise for a fluent way to convert an error into an Exn instance.
Sourcepub fn from_iter<T, I>(children: I, err: E) -> Self
pub fn from_iter<T, I>(children: I, err: E) -> Self
Create a new exception with the given error and children.
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for Exn<E>
impl<E> !RefUnwindSafe for Exn<E>
impl<E> Send for Exn<E>
impl<E> Sync for Exn<E>
impl<E> Unpin for Exn<E>where
E: Unpin,
impl<E> !UnwindSafe for Exn<E>
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