pub struct DiagnosticsView<'a> { /* private fields */ }Expand description
Every diagnostic of a run, as one sequence: each fragment’s parse diagnostics first, in the order in which the document’s walk reaches the fragments, then the diagnostics that the run produced.
Created by Run::diagnostics. A fragment placed in the document more
than once contributes its parse diagnostics once, at the first place the
walk reaches it, because they are facts about the text, not about a
placement. A diagnostic reports a problem with a document: a severity, a
position, and a typed condition with its data
(diagnostics).
Implementations§
Source§impl<'a> DiagnosticsView<'a>
impl<'a> DiagnosticsView<'a>
Sourcepub fn iter(&self) -> impl Iterator<Item = &'a FlmDiagnostic> + 'a
pub fn iter(&self) -> impl Iterator<Item = &'a FlmDiagnostic> + 'a
Returns every kept diagnostic, in order.
Sourcepub fn retained_len(&self) -> usize
pub fn retained_len(&self) -> usize
The number of kept diagnostics.
A run may record more diagnostics than it keeps (see
RunOptions::max_diagnostics); the ones past the limit are not
counted here. DiagnosticsView::any_recorded and
DiagnosticsView::error_count do count them.
Sourcepub fn any_recorded(&self) -> bool
pub fn any_recorded(&self) -> bool
Whether any diagnostic was reported, kept or not.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Whether any diagnostic of Error severity was reported, kept or not. The run’s error gate checks this.
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
The number of diagnostics of Error severity that were reported, kept or not.
Sourcepub fn render_all(&self) -> String
pub fn render_all(&self) -> String
Renders every kept diagnostic as text, joined by line breaks; the diagnostics past the limit are not mentioned.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for DiagnosticsView<'a>
impl<'a> !UnwindSafe for DiagnosticsView<'a>
impl<'a> Forget for DiagnosticsView<'a>
impl<'a> Freeze for DiagnosticsView<'a>
impl<'a> Move for DiagnosticsView<'a>
impl<'a> Send for DiagnosticsView<'a>
impl<'a> Sync for DiagnosticsView<'a>where
RawVecInner: Sync,
Arc<Fragment>: Sync,
NodeRef<Owned, NodeAddr, TreeId, LeafOrInternal>: Sync,
BoxRaw<(NodeAddr, TreeId)>: Sync,
NodeRef<Owned, TreeId, NodeAddr, LeafOrInternal>: Sync,
BoxRaw<(TreeId, NodeAddr)>: Sync,
NodeRef<Owned, OptionKey, OptionValue, LeafOrInternal>: Sync,
BoxRaw<(OptionKey, OptionValue)>: Sync,
BoxRaw<dyn DiagnosticData>: Sync,
Arc<Source<FlmOrigin>>: Sync,
impl<'a> Unpin for DiagnosticsView<'a>
impl<'a> UnsafeUnpin for DiagnosticsView<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more