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.