pub struct DiagnosticSet { /* private fields */ }Expand description
An immutable set of diagnostics.
Implementations§
Source§impl DiagnosticSet
impl DiagnosticSet
Sourcepub const fn counts(&self) -> SeverityCounts
pub const fn counts(&self) -> SeverityCounts
An accounting of this set’s diagnostics in terms of severity
Sourcepub const fn has_errors(&self) -> bool
pub const fn has_errors(&self) -> bool
Returns true if this set contains any errors
Sourcepub fn iter(&self) -> Iter<'_, DiagnosticEntry> ⓘ
pub fn iter(&self) -> Iter<'_, DiagnosticEntry> ⓘ
Get an iterator over the diagnostics in this set
Sourcepub fn into_vec(self) -> Vec<DiagnosticEntry>
pub fn into_vec(self) -> Vec<DiagnosticEntry>
Consume this set, producing a vector of the underlying diagnostics in the set
Sourcepub fn attach_session_sources<P>(self, sources: Arc<P>) -> Self
pub fn attach_session_sources<P>(self, sources: Arc<P>) -> Self
Retains the session source provider needed to resolve this set’s session spans.
The provider is shared by all diagnostic occurrences, so attaching it is cheap when the
caller already owns it through an Arc.
Sourcepub fn assess<P>(&self, policy: &P) -> boolwhere
P: FailurePolicy + ?Sized,
pub fn assess<P>(&self, policy: &P) -> boolwhere
P: FailurePolicy + ?Sized,
Evaluate a FailurePolicy against this set, returning true if the policy dictates that the outcome of a related operation should be considered a failure.
Source§impl DiagnosticSet
impl DiagnosticSet
Sourcepub fn prepare_attached(&self) -> Result<PreparedSet<'_>, PrepareError>
pub fn prepare_attached(&self) -> Result<PreparedSet<'_>, PrepareError>
Prepares this set using the session and attached source providers retained by each diagnostic occurrence.
Sourcepub fn prepare_attached_with_limits(
&self,
limits: PreparationLimits,
) -> Result<PreparedSet<'_>, PrepareError>
pub fn prepare_attached_with_limits( &self, limits: PreparationLimits, ) -> Result<PreparedSet<'_>, PrepareError>
Prepares this set using retained providers and explicit resource limits.