pub struct Report<'a, S: Span = Range<usize>> { /* private fields */ }
Expand description
A type representing a diagnostic that is ready to be written to output.
Implementations§
source§impl<S: Span> Report<'_, S>
impl<S: Span> Report<'_, S>
sourcepub fn write<C: Cache<S::SourceId>, W: Write>(
&self,
cache: C,
w: W
) -> Result<()>
pub fn write<C: Cache<S::SourceId>, W: Write>( &self, cache: C, w: W ) -> Result<()>
Write this diagnostic to an implementor of Write
.
If using the concolor
feature, this method assumes that the output is ultimately going to be printed to
stderr
. If you are printing to stdout
, use the write_for_stdout
method instead.
If you wish to write to stderr
or stdout
, you can do so via Report::eprint
or Report::print
respectively.
source§impl<S: Span> Report<'_, S>
impl<S: Span> Report<'_, S>
sourcepub fn build<Id: Into<<S::SourceId as ToOwned>::Owned>>(
kind: ReportKind<'_>,
src_id: Id,
offset: usize
) -> ReportBuilder<'_, S>
pub fn build<Id: Into<<S::SourceId as ToOwned>::Owned>>( kind: ReportKind<'_>, src_id: Id, offset: usize ) -> ReportBuilder<'_, S>
Begin building a new Report
.
sourcepub fn eprint<C: Cache<S::SourceId>>(&self, cache: C) -> Result<()>
pub fn eprint<C: Cache<S::SourceId>>(&self, cache: C) -> Result<()>
Write this diagnostic out to stderr
.
sourcepub fn print<C: Cache<S::SourceId>>(&self, cache: C) -> Result<()>
pub fn print<C: Cache<S::SourceId>>(&self, cache: C) -> Result<()>
Write this diagnostic out to stdout
.
In most cases, Report::eprint
is the
‘more correct’ function to use.
Trait Implementations§
Auto Trait Implementations§
impl<'a, S> RefUnwindSafe for Report<'a, S>
impl<'a, S> Send for Report<'a, S>
impl<'a, S> Sync for Report<'a, S>
impl<'a, S> Unpin for Report<'a, S>
impl<'a, S> UnwindSafe for Report<'a, S>
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