pub struct MapPhraseSetLinter<'a> { /* private fields */ }
Implementations§
Source§impl<'a> MapPhraseSetLinter<'a>
impl<'a> MapPhraseSetLinter<'a>
pub fn one_to_one( wrong_forms_to_correct_forms: &'a [(&'a str, &'a str)], message: impl ToString, description: impl ToString, lint_kind: Option<LintKind>, ) -> Self
pub fn many_to_many( multi_wrong_forms_to_multi_correct_forms: &'a [(&'a [&'a str], &'a [&'a str])], message: impl ToString, description: impl ToString, lint_kind: Option<LintKind>, ) -> Self
Trait Implementations§
Source§impl<'a> ExprLinter for MapPhraseSetLinter<'a>
impl<'a> ExprLinter for MapPhraseSetLinter<'a>
Source§fn match_to_lint(
&self,
matched_tokens: &[Token],
source: &[char],
) -> Option<Lint>
fn match_to_lint( &self, matched_tokens: &[Token], source: &[char], ) -> Option<Lint>
If any portions of a
Document
match Self::expr
, they are passed through ExprLinter::match_to_lint
to be
transformed into a Lint
for editor consumption. Read moreSource§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<'a> Freeze for MapPhraseSetLinter<'a>
impl<'a> !RefUnwindSafe for MapPhraseSetLinter<'a>
impl<'a> !Send for MapPhraseSetLinter<'a>
impl<'a> !Sync for MapPhraseSetLinter<'a>
impl<'a> Unpin for MapPhraseSetLinter<'a>
impl<'a> !UnwindSafe for MapPhraseSetLinter<'a>
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<L> HtmlDescriptionLinter for L
impl<L> HtmlDescriptionLinter for L
fn description_html(&self) -> String
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 moreSource§impl<L> Linter for Lwhere
L: ExprLinter,
impl<L> Linter for Lwhere
L: ExprLinter,
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.