pub struct Grapheme<'a> { /* private fields */ }Expand description
One grapheme.
Implementations§
Source§impl<'a> Grapheme<'a>
impl<'a> Grapheme<'a>
pub fn new(grapheme: Cow<'a, str>, text_bytes: Range<usize>) -> Grapheme<'a>
Sourcepub fn is_whitespace(&self) -> bool
pub fn is_whitespace(&self) -> bool
First (only) char of the grapheme is a whitespace.
Sourcepub fn is_alphanumeric(&self) -> bool
pub fn is_alphanumeric(&self) -> bool
First (only) char of the grapheme is a whitespace.
Sourcepub fn is_line_break(&self) -> bool
pub fn is_line_break(&self) -> bool
Is a linebreak.
Sourcepub fn text_bytes(&self) -> Range<usize>
pub fn text_bytes(&self) -> Range<usize>
Get the byte-range as absolute range into the complete text.
Trait Implementations§
impl<'a> StructuralPartialEq for Grapheme<'a>
Auto Trait Implementations§
impl<'a> Freeze for Grapheme<'a>
impl<'a> RefUnwindSafe for Grapheme<'a>
impl<'a> Send for Grapheme<'a>
impl<'a> Sync for Grapheme<'a>
impl<'a> Unpin for Grapheme<'a>
impl<'a> UnwindSafe for Grapheme<'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<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