Struct Report

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

Location dependent problem report content.

This type contains information about a given error, primarily the backtrace, location and timestamp of the error, although reporters may include extra information.

Note that the Backtrace is NOT resolved during creation, to prevent wasting time on the creation of non-reported errors.

Implementations§

Source§

impl Report

Source

pub fn backtrace(&self) -> impl Deref<Target = Backtrace> + '_

Resolves and returns a reference to the error backtrace.

Source

pub fn backtrace_unresolved(&self) -> impl Deref<Target = Backtrace> + '_

Returns a reference to the unresolved backtrace.

Source

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

Returns the location where the error happened.

We try our best to fetch the correct location of the error by marking everything that may create a Problem with #[track_caller].

Source

pub fn timestamp(&self) -> DateTime<Local>

Returns the timestamp of when the error was captured.

Source

pub fn insert<T: Send + Sync + 'static>(&mut self, val: T)

Inserts an arbitrary data into the report.

Source

pub fn get<T: Send + Sync + 'static>(&self) -> Option<&T>

Get data inserted in the report via Self::insert.

Returns None if no data with the given type is found.

Trait Implementations§

Source§

impl Default for Report

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl EyreHandler for Report

Source§

fn debug(&self, error: &(dyn Error + 'static), f: &mut Formatter<'_>) -> Result

Define the report format Read more
Source§

fn track_caller(&mut self, location: &'static Location<'static>)

Store the location of the caller who constructed this error report
Source§

fn display( &self, error: &(dyn Error + 'static), f: &mut Formatter<'_>, ) -> Result<(), Error>

Override for the Display format

Auto Trait Implementations§

§

impl !Freeze for Report

§

impl !RefUnwindSafe for Report

§

impl Send for Report

§

impl Sync for Report

§

impl Unpin for Report

§

impl !UnwindSafe for Report

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, 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.