pub struct LintStore {
config: LintConfiguration,
lint_constructors: Vec<fn(&LintRuleConfiguration) -> Box<dyn LintRule>>,
initialized_lints: BTreeMap<String, Box<dyn LintRule>>,
}Expand description
The LintStore, which contains all available and known lint rules.
It can be used to further filter and select lints based on various criteria.
Fields§
§config: LintConfiguration§lint_constructors: Vec<fn(&LintRuleConfiguration) -> Box<dyn LintRule>>§initialized_lints: BTreeMap<String, Box<dyn LintRule>>Implementations§
Source§impl LintStore
impl LintStore
Sourcepub fn new(config: LintConfiguration) -> Self
pub fn new(config: LintConfiguration) -> Self
Creates a new LintStore.
This adds all known lint rules to the store.
Sourcefn register(&mut self)
fn register(&mut self)
Registers all lints that are made available in the store.
§Note
New lints must be specified in this function!
Sourcefn initialize_lint_rules(&mut self)
fn initialize_lint_rules(&mut self)
Initializes and configures all linting rules.
This function instantly returns if the lints have already been initialized.
Sourcepub fn lint_rules(&self) -> &BTreeMap<String, Box<dyn LintRule>>
pub fn lint_rules(&self) -> &BTreeMap<String, Box<dyn LintRule>>
Returns a reference to the map of all available and configured lint rules.
Sourcepub fn lint_rule_by_name(&self, name: &ScopedName) -> Option<&Box<dyn LintRule>>
pub fn lint_rule_by_name(&self, name: &ScopedName) -> Option<&Box<dyn LintRule>>
Returns a specific lint rule by its scoped name.
Returns None if no lint rule with a matching name exists.
Sourcepub fn serializable_lint_rules(&self) -> BTreeMap<String, SerializableLintRule>
pub fn serializable_lint_rules(&self) -> BTreeMap<String, SerializableLintRule>
Returns a map of all available and configured lint rules as SerializableLintRule.
Sourcepub fn filtered_lint_rules<'a>(
&'a self,
scope: &LintScope,
max_level: Level,
) -> FilteredLintRules<'a> ⓘ
pub fn filtered_lint_rules<'a>( &'a self, scope: &LintScope, max_level: Level, ) -> FilteredLintRules<'a> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LintStore
impl !RefUnwindSafe for LintStore
impl !Send for LintStore
impl !Sync for LintStore
impl Unpin for LintStore
impl !UnwindSafe for LintStore
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