pub struct ErrorReport<'buf> { /* private fields */ }
Expand description
A more comprehensive report on the Error
using the source JSON &str
to provide
human readable context.
Implementations§
Source§impl<'buf> ErrorReport<'buf>
impl<'buf> ErrorReport<'buf>
Sourcepub fn json_context(&self) -> &'buf str
pub fn json_context(&self) -> &'buf str
Return the slice of JSON as defined by the Error::span
.
Sourcepub fn expand_json_context(&self) -> &'buf str
pub fn expand_json_context(&self) -> &'buf str
Return the slice of JSON as defined by the Error::span
and expanded out to the
start and end of the line.
Sourcepub fn span_bounds(&self) -> &SpanBounds
pub fn span_bounds(&self) -> &SpanBounds
Return the line and col number of each end of the span
Sourcepub fn into_error(self) -> Error
pub fn into_error(self) -> Error
Discard the Report
and take ownership of the Error
.
Trait Implementations§
Auto Trait Implementations§
impl<'buf> Freeze for ErrorReport<'buf>
impl<'buf> !RefUnwindSafe for ErrorReport<'buf>
impl<'buf> Send for ErrorReport<'buf>
impl<'buf> Sync for ErrorReport<'buf>
impl<'buf> Unpin for ErrorReport<'buf>
impl<'buf> !UnwindSafe for ErrorReport<'buf>
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