pub struct ErrorReport<C = NoErrorCode> { /* private fields */ }Available on crate feature
terminal only.Expand description
Wraps an anyhow::Error to render it, with its source chain,
backtrace and code, as text or JSON.
Implementations§
Source§impl ErrorReport
impl ErrorReport
Source§impl<C: ErrorCode> ErrorReport<C>
impl<C: ErrorCode> ErrorReport<C>
Sourcepub fn eval_coded<T>(printer: &mut impl Printer, result: Result<T, Error>) -> T
pub fn eval_coded<T>(printer: &mut impl Printer, result: Result<T, Error>) -> T
Unwraps a result, or prints the error to the printer, with the code of the chain when it carries one, and exits with status 1.
A PartialOutcome in the chain means the result is already
printed: the process exits with its status, printing nothing more.
Trait Implementations§
Source§impl<C: ErrorCode> Display for ErrorReport<C>
impl<C: ErrorCode> Display for ErrorReport<C>
Source§impl<C: ErrorCode> JsonSchema for ErrorReport<C>
impl<C: ErrorCode> JsonSchema for ErrorReport<C>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl<C> Freeze for ErrorReport<C>
impl<C> RefUnwindSafe for ErrorReport<C>where
Option<C>: RefUnwindSafe,
impl<C> Send for ErrorReport<C>
impl<C> Sync for ErrorReport<C>
impl<C> Unpin for ErrorReport<C>
impl<C> UnsafeUnpin for ErrorReport<C>where
Option<C>: UnsafeUnpin,
impl<C> UnwindSafe for ErrorReport<C>where
Option<C>: UnwindSafe,
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