pub struct Diagnostics<S = Span> { /* private fields */ }Expand description
A basic wrapper around Vec<Diagnostic> with pretty debug printing and utility methods.
Implementations§
Source§impl<S> Diagnostics<S>
impl<S> Diagnostics<S>
Sourcepub fn retain_level(&mut self, level: Level)
pub fn retain_level(&mut self, level: Level)
Retains only diagnostics as severe as level or more severe.
Sourcepub fn push(&mut self, diagnostic: Diagnostic<S>)
pub fn push(&mut self, diagnostic: Diagnostic<S>)
Adds a diagnostic to this collection.
Sourcepub fn iter(&self) -> Iter<'_, Diagnostic<S>>
pub fn iter(&self) -> Iter<'_, Diagnostic<S>>
Returns an iterator over the diagnostics.
Source§impl Diagnostics
impl Diagnostics
Sourcepub fn try_emit_all(&self) -> Result<(), TokenStream>
pub fn try_emit_all(&self) -> Result<(), TokenStream>
Emits all if possible, otherwise returns Err containing a TokenStream of code spanned to emit each error
and warning indirectly.
Trait Implementations§
Source§impl<S> Debug for Diagnostics<S>where
Diagnostic<S>: Display,
impl<S> Debug for Diagnostics<S>where
Diagnostic<S>: Display,
Source§impl<S> Default for Diagnostics<S>
impl<S> Default for Diagnostics<S>
Source§impl<S> Extend<Diagnostic<S>> for Diagnostics<S>
impl<S> Extend<Diagnostic<S>> for Diagnostics<S>
Source§fn extend<T: IntoIterator<Item = Diagnostic<S>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Diagnostic<S>>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<S> FromIterator<Diagnostic<S>> for Diagnostics<S>
impl<S> FromIterator<Diagnostic<S>> for Diagnostics<S>
Source§fn from_iter<T: IntoIterator<Item = Diagnostic<S>>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Diagnostic<S>>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl<S> IntoIterator for Diagnostics<S>
impl<S> IntoIterator for Diagnostics<S>
Auto Trait Implementations§
impl<S> Freeze for Diagnostics<S>
impl<S> RefUnwindSafe for Diagnostics<S>where
S: RefUnwindSafe,
impl<S> Send for Diagnostics<S>where
S: Send,
impl<S> Sync for Diagnostics<S>where
S: Sync,
impl<S> Unpin for Diagnostics<S>where
S: Unpin,
impl<S> UnwindSafe for Diagnostics<S>where
S: UnwindSafe,
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
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>
Converts
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>
Converts
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