Expand description
A type representing a diagnostic that is ready to be written to output.
Implementations
sourceimpl<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 you wish to write to stderr
or stdout
, you can do so via Report::eprint
or Report::print
respectively.
sourceimpl<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.
Auto Trait Implementations
impl<S> RefUnwindSafe for Report<S>where
S: RefUnwindSafe,
<<S as Span>::SourceId as ToOwned>::Owned: RefUnwindSafe,
impl<S> Send for Report<S>where
S: Send,
<<S as Span>::SourceId as ToOwned>::Owned: Send,
impl<S> Sync for Report<S>where
S: Sync,
<<S as Span>::SourceId as ToOwned>::Owned: Sync,
impl<S> Unpin for Report<S>where
S: Unpin,
<<S as Span>::SourceId as ToOwned>::Owned: Unpin,
impl<S> UnwindSafe for Report<S>where
S: UnwindSafe,
<<S as Span>::SourceId as ToOwned>::Owned: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more