pub struct DiagnosticsConfig {
pub unused_import: Option<Severity>,
pub unused_input: Option<Severity>,
pub unused_declaration: Option<Severity>,
pub unused_call: Option<Severity>,
pub unnecessary_function_call: Option<Severity>,
}Expand description
Configuration for analysis diagnostics.
Only the analysis diagnostics that aren’t inherently treated as errors are represented here.
These diagnostics default to a warning severity.
Fields§
§unused_import: Option<Severity>The severity for the “unused import” diagnostic.
A value of None disables the diagnostic.
unused_input: Option<Severity>The severity for the “unused input” diagnostic.
A value of None disables the diagnostic.
unused_declaration: Option<Severity>The severity for the “unused declaration” diagnostic.
A value of None disables the diagnostic.
unused_call: Option<Severity>The severity for the “unused call” diagnostic.
A value of None disables the diagnostic.
unnecessary_function_call: Option<Severity>The severity for the “unnecessary function call” diagnostic.
A value of None disables the diagnostic.
Implementations§
Source§impl DiagnosticsConfig
impl DiagnosticsConfig
Sourcepub fn new<T: AsRef<dyn Rule>>(rules: impl IntoIterator<Item = T>) -> Self
pub fn new<T: AsRef<dyn Rule>>(rules: impl IntoIterator<Item = T>) -> Self
Creates a new diagnostics configuration from a rule set.
Sourcepub fn excepted_for_node(self, node: &SyntaxNode) -> Self
pub fn excepted_for_node(self, node: &SyntaxNode) -> Self
Gets the excepted set of diagnostics based on any #@ except comments
that precede the given syntax node.
Sourcepub fn except_all() -> Self
pub fn except_all() -> Self
Excepts all of the diagnostics.
Trait Implementations§
Source§impl Clone for DiagnosticsConfig
impl Clone for DiagnosticsConfig
Source§fn clone(&self) -> DiagnosticsConfig
fn clone(&self) -> DiagnosticsConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiagnosticsConfig
impl Debug for DiagnosticsConfig
impl Copy for DiagnosticsConfig
Auto Trait Implementations§
impl Freeze for DiagnosticsConfig
impl RefUnwindSafe for DiagnosticsConfig
impl Send for DiagnosticsConfig
impl Sync for DiagnosticsConfig
impl Unpin for DiagnosticsConfig
impl UnwindSafe for DiagnosticsConfig
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
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>
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>
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