pub struct NarratableReportHandler { /* private fields */ }
Expand description
ReportHandler
that renders plain text and avoids extraneous graphics.
It’s optimized for screen readers and braille users, but is also used in any
non-graphical environments, such as non-TTY output.
Implementations§
Source§impl NarratableReportHandler
impl NarratableReportHandler
Sourcepub const fn new() -> NarratableReportHandler
pub const fn new() -> NarratableReportHandler
Create a new NarratableReportHandler
. There are no customization
options.
Sourcepub const fn with_cause_chain(self) -> NarratableReportHandler
pub const fn with_cause_chain(self) -> NarratableReportHandler
Include the cause chain of the top-level error in the report, if available.
Sourcepub const fn without_cause_chain(self) -> NarratableReportHandler
pub const fn without_cause_chain(self) -> NarratableReportHandler
Do not include the cause chain of the top-level error in the report.
Set the footer to be displayed at the end of the report.
Sourcepub const fn with_context_lines(self, lines: usize) -> NarratableReportHandler
pub const fn with_context_lines(self, lines: usize) -> NarratableReportHandler
Sets the number of lines of context to show around each error.
Source§impl NarratableReportHandler
impl NarratableReportHandler
Sourcepub fn render_report(
&self,
f: &mut impl Write,
diagnostic: &dyn Diagnostic,
) -> Result<(), Error>
pub fn render_report( &self, f: &mut impl Write, diagnostic: &dyn Diagnostic, ) -> Result<(), Error>
Render a Diagnostic
. This function is mostly internal and meant to
be called by the toplevel ReportHandler
handler, but is
made public to make it easier (possible) to test in isolation from
global state.
Trait Implementations§
Source§impl Clone for NarratableReportHandler
impl Clone for NarratableReportHandler
Source§fn clone(&self) -> NarratableReportHandler
fn clone(&self) -> NarratableReportHandler
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NarratableReportHandler
impl Debug for NarratableReportHandler
Source§impl Default for NarratableReportHandler
impl Default for NarratableReportHandler
Source§fn default() -> NarratableReportHandler
fn default() -> NarratableReportHandler
Returns the “default value” for a type. Read more
Source§impl ReportHandler for NarratableReportHandler
impl ReportHandler for NarratableReportHandler
Source§fn debug(
&self,
diagnostic: &dyn Diagnostic,
f: &mut Formatter<'_>,
) -> Result<(), Error>
fn debug( &self, diagnostic: &dyn Diagnostic, f: &mut Formatter<'_>, ) -> Result<(), Error>
Define the report format Read more
Source§fn display(
&self,
error: &(dyn Error + 'static),
f: &mut Formatter<'_>,
) -> Result<(), Error>
fn display( &self, error: &(dyn Error + 'static), f: &mut Formatter<'_>, ) -> Result<(), Error>
Override for the
Display
formatSource§fn track_caller(&mut self, location: &'static Location<'static>)
fn track_caller(&mut self, location: &'static Location<'static>)
Store the location of the caller who constructed this error report
Auto Trait Implementations§
impl Freeze for NarratableReportHandler
impl RefUnwindSafe for NarratableReportHandler
impl Send for NarratableReportHandler
impl Sync for NarratableReportHandler
impl Unpin for NarratableReportHandler
impl UnwindSafe for NarratableReportHandler
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more