Skip to main content

DiagnosticSet

Struct DiagnosticSet 

Source
pub struct DiagnosticSet { /* private fields */ }
Expand description

An immutable set of diagnostics.

Implementations§

Source§

impl DiagnosticSet

Source

pub fn len(&self) -> usize

The number of diagnostics in this set

Source

pub fn is_empty(&self) -> bool

Returns true if the set is empty

Source

pub const fn counts(&self) -> SeverityCounts

An accounting of this set’s diagnostics in terms of severity

Source

pub const fn has_errors(&self) -> bool

Returns true if this set contains any errors

Source

pub fn iter(&self) -> Iter<'_, DiagnosticEntry> ⓘ

Get an iterator over the diagnostics in this set

Source

pub fn into_vec(self) -> Vec<DiagnosticEntry>

Consume this set, producing a vector of the underlying diagnostics in the set

Source

pub fn attach_session_sources<P>(self, sources: Arc<P>) -> Self
where P: SourceProvider + Send + Sync + 'static + ?Sized,

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.

Source

pub fn assess<P>(&self, policy: &P) -> bool
where 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

Source

pub fn prepare_attached(&self) -> Result<PreparedSet<'_>, PrepareError>

Prepares this set using the session and attached source providers retained by each diagnostic occurrence.

Source

pub fn prepare_attached_with_limits( &self, limits: PreparationLimits, ) -> Result<PreparedSet<'_>, PrepareError>

Prepares this set using retained providers and explicit resource limits.

Source

pub fn prepare<'a>( &'a self, session_sources: &'a dyn SourceProvider, ) -> Result<PreparedSet<'a>, PrepareError>

Source

pub fn prepare_with_limits<'a>( &'a self, session_sources: &'a dyn SourceProvider, limits: PreparationLimits, ) -> Result<PreparedSet<'a>, PrepareError>

Trait Implementations§

Source§

impl Debug for DiagnosticSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DiagnosticSet

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl IntoIterator for DiagnosticSet

Source§

type IntoIter = IntoIter<DiagnosticEntry>

Which kind of iterator are we turning this into?
Source§

type Item = DiagnosticEntry

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> IntoIterator for &'a DiagnosticSet

Source§

type IntoIter = Iter<'a, DiagnosticEntry>

Which kind of iterator are we turning this into?
Source§

type Item = &'a DiagnosticEntry

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.