Frame

Struct Frame 

Source
pub struct Frame { /* private fields */ }
Expand description

A frame in the exception tree.

Implementations§

Source§

impl Frame

Source

pub fn error(&self) -> &(dyn Error + Send + Sync + 'static)

Return the error as a reference to Error.

Source

pub fn location(&self) -> &'static Location<'static>

Return the source code location where this exception frame was created.

Source

pub fn children(&self) -> &[Frame]

Return a slice of the children of the exception.

Source§

impl Frame

Navigation

Source

pub fn probable_cause(&self) -> Option<&Frame>

Find the best possible cause:

  • in a linear chain of a single error each, it’s the last-most child frame
  • in trees, find the deepest-possible frame that has the most leafs as children

Return None if there are no children.

Source

pub fn iter_frames(&self) -> impl Iterator<Item = &Frame> + '_

Iterate over all frames in breadth-first order. The first frame is this instance, followed by all of its children.

Trait Implementations§

Source§

impl Debug for Frame

Source§

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

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

impl Display for Frame

Source§

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

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

impl<E> From<Exn<E>> for Box<Frame>
where E: Error + Send + Sync + 'static,

Source§

fn from(err: Exn<E>) -> Self

Converts to this type from the input type.
Source§

impl<E> From<Exn<E>> for Frame
where E: Error + Send + Sync + 'static,

Source§

fn from(err: Exn<E>) -> Self

Converts to this type from the input type.
Source§

impl From<Frame> for Exn

Source§

fn from(frame: Frame) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Frame

§

impl !RefUnwindSafe for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl !UnwindSafe for Frame

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.

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§

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.