pub struct PatternLinterCache<P: PatternLinter> { /* private fields */ }
Expand description
A cache that wraps around a PatternLinter
, caching
results by chunk.
Implementations§
Source§impl<P: PatternLinter> PatternLinterCache<P>
impl<P: PatternLinter> PatternLinterCache<P>
Sourcepub fn new(inner: P, cache_size: NonZeroUsize) -> Self
pub fn new(inner: P, cache_size: NonZeroUsize) -> Self
Add a cache to a given PatternLinter
with a given cache size.
About a 1000 rows is recommended.
Trait Implementations§
Source§impl<P: PatternLinter> Linter for PatternLinterCache<P>
impl<P: PatternLinter> Linter for PatternLinterCache<P>
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<P> Freeze for PatternLinterCache<P>where
P: Freeze,
impl<P> RefUnwindSafe for PatternLinterCache<P>where
P: RefUnwindSafe,
impl<P> !Send for PatternLinterCache<P>
impl<P> !Sync for PatternLinterCache<P>
impl<P> Unpin for PatternLinterCache<P>where
P: Unpin,
impl<P> UnwindSafe for PatternLinterCache<P>where
P: UnwindSafe,
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