pub struct Report { /* private fields */ }
Expand description
A type representing a diagnostic that is ready to be written to output.
Implementations§
Source§impl Report
impl Report
Sourcepub fn write<W: Write>(&self, cache: FileCache, w: W) -> Result<()>
pub fn write<W: Write>(&self, cache: FileCache, 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 Report
impl Report
Sourcepub fn new<R>(kind: R, src_id: FileID, offset: usize) -> ReportBuilderwhere
R: ReportLevel + 'static,
pub fn new<R>(kind: R, src_id: FileID, offset: usize) -> ReportBuilderwhere
R: ReportLevel + 'static,
Begin building a new Report
.
Sourcepub fn print(&self, cache: FileCache) -> Result<()>
pub fn print(&self, cache: FileCache) -> 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 Freeze for Report
impl !RefUnwindSafe for Report
impl !Send for Report
impl !Sync for Report
impl Unpin for Report
impl !UnwindSafe for Report
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