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.
Sourcepub fn exceptable_add(
&mut self,
diagnostic: Diagnostic,
element: SyntaxElement,
exceptable_nodes: &Option<&'static [SyntaxKind]>,
)
pub fn exceptable_add( &mut self, diagnostic: Diagnostic, element: SyntaxElement, 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 extend(&mut self, diagnostics: Diagnostics)
pub fn extend(&mut self, diagnostics: Diagnostics)
Extends the collection with another collection of diagnostics.
Trait Implementations§
Source§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
Auto Trait Implementations§
impl Freeze for Diagnostics
impl RefUnwindSafe for Diagnostics
impl Send for Diagnostics
impl Sync for Diagnostics
impl Unpin 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> 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