pub struct Diagnostics { /* private fields */ }Expand description
Represents a collection of validation diagnostics.
Validation visitors receive a diagnostics collection during visitation of the AST.
Implementations§
Source§impl Diagnostics
impl Diagnostics
Sourcepub fn add(&mut self, diagnostic: Diagnostic)
pub fn add(&mut self, diagnostic: Diagnostic)
Adds a diagnostic to the collection.
NOTE: This is intended for diagnostics that cannot be suppressed.
Otherwise, Diagnostics::exceptable_add() should be used.
Sourcepub fn add_exceptions(
&mut self,
exceptions: impl IntoIterator<Item = ExceptRule>,
)
pub fn add_exceptions( &mut self, exceptions: impl IntoIterator<Item = ExceptRule>, )
Adds rule exceptions to the collection.
Sourcepub fn exceptable_add<N: TreeNode + Exceptable>(
&mut self,
diagnostic: Diagnostic,
element: &N,
exceptable_nodes: &Option<&'static [SyntaxKind]>,
)
pub fn exceptable_add<N: TreeNode + Exceptable>( &mut self, diagnostic: Diagnostic, element: &N, exceptable_nodes: &Option<&'static [SyntaxKind]>, )
Adds a diagnostic to the collection, unless the diagnostic is for an element that has an exception for the given rule.
If the diagnostic does not have a rule, the diagnostic is always added.
Sourcepub fn iter(&self) -> Iter<'_, Diagnostic>
pub fn iter(&self) -> Iter<'_, Diagnostic>
Iterate the diagnostics emitted so far.
Trait Implementations§
Source§impl Clone for Diagnostics
impl Clone for Diagnostics
Source§fn clone(&self) -> Diagnostics
fn clone(&self) -> Diagnostics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Diagnostics
impl Debug for Diagnostics
Source§impl Default for Diagnostics
impl Default for Diagnostics
Source§fn default() -> Diagnostics
fn default() -> Diagnostics
Returns the “default value” for a type. Read more
Source§impl Extend<Diagnostic> for Diagnostics
impl Extend<Diagnostic> for Diagnostics
Source§fn extend<I: IntoIterator<Item = Diagnostic>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = Diagnostic>>(&mut self, iter: I)
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 From<Diagnostics> for Vec<Diagnostic>
impl From<Diagnostics> for Vec<Diagnostic>
Source§fn from(input: Diagnostics) -> Self
fn from(input: Diagnostics) -> Self
Converts to this type from the input type.
Source§impl IntoIterator for Diagnostics
impl IntoIterator for Diagnostics
Auto Trait Implementations§
impl Freeze for Diagnostics
impl RefUnwindSafe for Diagnostics
impl Send for Diagnostics
impl Sync for Diagnostics
impl Unpin for Diagnostics
impl UnsafeUnpin for Diagnostics
impl UnwindSafe for Diagnostics
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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