pub struct JSONReportHandler;
Expand description
ReportHandler
that renders JSON output. It’s a machine-readable output.
Implementations§
Source§impl JSONReportHandler
impl JSONReportHandler
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create a new JSONReportHandler
. There are no customization
options.
Source§impl JSONReportHandler
impl JSONReportHandler
Sourcepub fn render_report(
&self,
f: &mut impl Write,
diagnostic: &dyn Diagnostic,
) -> Result
pub fn render_report( &self, f: &mut impl Write, diagnostic: &dyn Diagnostic, ) -> Result
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 JSONReportHandler
impl Clone for JSONReportHandler
Source§fn clone(&self) -> JSONReportHandler
fn clone(&self) -> JSONReportHandler
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 JSONReportHandler
impl Debug for JSONReportHandler
Source§impl Default for JSONReportHandler
impl Default for JSONReportHandler
Source§impl ReportHandler for JSONReportHandler
impl ReportHandler for JSONReportHandler
Source§fn debug(&self, diagnostic: &dyn Diagnostic, f: &mut Formatter<'_>) -> Result
fn debug(&self, diagnostic: &dyn Diagnostic, f: &mut Formatter<'_>) -> Result
Define the report format Read more
Source§fn display(
&self,
error: &(dyn StdError + 'static),
f: &mut Formatter<'_>,
) -> Result
fn display( &self, error: &(dyn StdError + 'static), f: &mut Formatter<'_>, ) -> Result
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 JSONReportHandler
impl RefUnwindSafe for JSONReportHandler
impl Send for JSONReportHandler
impl Sync for JSONReportHandler
impl Unpin for JSONReportHandler
impl UnwindSafe for JSONReportHandler
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