pub struct RegexMasker { /* private fields */ }Expand description
Allows one to mask the sections of a document that match a regular expression (or vice versa).
Implementations§
Source§impl RegexMasker
impl RegexMasker
Sourcepub fn new(regex: &str, exclude_matches: bool) -> Option<Self>
pub fn new(regex: &str, exclude_matches: bool) -> Option<Self>
Parses and compiles the provided Regex expression. Returns None if an invalid expression was provided.
If exclude_matches is marked true, then the areas selected by the regular expression
will be removed from Harper’s view. If it is false, those areas will be the only ones
included.
Trait Implementations§
Source§impl Masker for RegexMasker
impl Masker for RegexMasker
fn create_mask(&self, source: &[char]) -> Mask
Auto Trait Implementations§
impl Freeze for RegexMasker
impl RefUnwindSafe for RegexMasker
impl Send for RegexMasker
impl Sync for RegexMasker
impl Unpin for RegexMasker
impl UnwindSafe for RegexMasker
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