pub struct LintGroup {
pub config: LintGroupConfig,
/* private fields */
}
Fields§
§config: LintGroupConfig
Implementations§
Source§impl LintGroup
impl LintGroup
pub fn empty() -> Self
Sourcepub fn add(&mut self, name: impl AsRef<str>, linter: Box<dyn Linter>) -> bool
pub fn add(&mut self, name: impl AsRef<str>, linter: Box<dyn Linter>) -> bool
Add a Linter
to the group, returning whether the operation was successful.
If it returns false
, it is because a linter with that key already existed in the group.
Sourcepub fn merge_from(&mut self, other: &mut LintGroup)
pub fn merge_from(&mut self, other: &mut LintGroup)
Merge the contents of another LintGroup
into this one.
The other lint group will be left empty after this operation.
Sourcepub fn set_all_rules_to(&mut self, enabled: Option<bool>)
pub fn set_all_rules_to(&mut self, enabled: Option<bool>)
Set all contained rules to a specific value.
Passing None
will unset that rule, allowing it to assume its default state.
pub fn all_descriptions(&self) -> HashMap<&str, &str>
Sourcepub fn with_lint_config(self, config: LintGroupConfig) -> Self
pub fn with_lint_config(self, config: LintGroupConfig) -> Self
Swap out Self::config
with another LintGroupConfig
.
pub fn new_curated(dictionary: Arc<impl Dictionary + 'static>) -> Self
Sourcepub fn new_curated_empty_config(
dictionary: Arc<impl Dictionary + 'static>,
) -> Self
pub fn new_curated_empty_config( dictionary: Arc<impl Dictionary + 'static>, ) -> Self
Create a new curated group with all config values cleared out.
Trait Implementations§
Source§impl Linter for LintGroup
impl Linter for LintGroup
Source§fn lint(&mut self, document: &Document) -> Vec<Lint>
fn lint(&mut self, document: &Document) -> Vec<Lint>
Analyzes a document and produces zero or more
Lint
s.
We pass self
mutably for caching purposes.Source§fn description(&self) -> &str
fn description(&self) -> &str
A user-facing description of what kinds of grammatical errors this rule looks for.
It is usually shown in settings menus.
Auto Trait Implementations§
impl Freeze for LintGroup
impl !RefUnwindSafe for LintGroup
impl !Send for LintGroup
impl !Sync for LintGroup
impl Unpin for LintGroup
impl !UnwindSafe for LintGroup
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> 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