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>,
pub using_fallback_version: 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.
using_fallback_version: Option<Severity>
The severity for the using fallback version diagnostic.
A value of None
disables the diagnostic. If there is no version
configured with Config::with_fallback_version()
, this diagnostic
will not be emitted.
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
Returns a modified set of diagnostics that accounts for 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
Source§impl Default for DiagnosticsConfig
impl Default for DiagnosticsConfig
Source§impl<'de> Deserialize<'de> for DiagnosticsConfig
impl<'de> Deserialize<'de> for DiagnosticsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for DiagnosticsConfig
impl PartialEq for DiagnosticsConfig
Source§impl Serialize for DiagnosticsConfig
impl Serialize for DiagnosticsConfig
impl Copy for DiagnosticsConfig
impl Eq for DiagnosticsConfig
impl StructuralPartialEq 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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