pub struct Mask { /* private fields */ }
Expand description
Identifies portions of a char
sequence that should not be ignored by
Harper.
Implementations§
Source§impl Mask
impl Mask
Sourcepub fn new_blank() -> Self
pub fn new_blank() -> Self
Create a new Mask for a given piece of text, marking all text as disallowed.
pub fn iter_allowed<'a>( &'a self, source: &'a [char], ) -> impl Iterator<Item = (Span<char>, &'a [char])>
Sourcepub fn push_allowed(&mut self, allowed: Span<char>)
pub fn push_allowed(&mut self, allowed: Span<char>)
Mark a span of the text as allowed.
Sourcepub fn merge_whitespace_sep(&mut self, source: &[char])
pub fn merge_whitespace_sep(&mut self, source: &[char])
Merge chunks that are only separated by whitespace.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mask
impl RefUnwindSafe for Mask
impl Send for Mask
impl Sync for Mask
impl Unpin for Mask
impl UnwindSafe for Mask
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