pub struct GraphemeClusterSegmenterBorrowed<'data> { /* private fields */ }
Expand description
Segments a string into grapheme clusters (borrowed version).
See GraphemeClusterSegmenter
for examples.
Implementations§
Source§impl<'data> GraphemeClusterSegmenterBorrowed<'data>
impl<'data> GraphemeClusterSegmenterBorrowed<'data>
Sourcepub fn segment_str<'s>(
self,
input: &'s str,
) -> GraphemeClusterBreakIterator<'data, 's, Utf8> ⓘ
pub fn segment_str<'s>( self, input: &'s str, ) -> GraphemeClusterBreakIterator<'data, 's, Utf8> ⓘ
Creates a grapheme cluster break iterator for an str
(a UTF-8 string).
Sourcepub fn segment_utf8<'s>(
self,
input: &'s [u8],
) -> GraphemeClusterBreakIterator<'data, 's, PotentiallyIllFormedUtf8> ⓘ
pub fn segment_utf8<'s>( self, input: &'s [u8], ) -> GraphemeClusterBreakIterator<'data, 's, PotentiallyIllFormedUtf8> ⓘ
Creates a grapheme cluster break iterator for a potentially ill-formed UTF8 string
Invalid characters are treated as REPLACEMENT CHARACTER
There are always breakpoints at 0 and the string length, or only at 0 for the empty string.
Sourcepub fn segment_latin1<'s>(
self,
input: &'s [u8],
) -> GraphemeClusterBreakIterator<'data, 's, Latin1> ⓘ
pub fn segment_latin1<'s>( self, input: &'s [u8], ) -> GraphemeClusterBreakIterator<'data, 's, Latin1> ⓘ
Creates a grapheme cluster break iterator for a Latin-1 (8-bit) string.
There are always breakpoints at 0 and the string length, or only at 0 for the empty string.
Sourcepub fn segment_utf16<'s>(
self,
input: &'s [u16],
) -> GraphemeClusterBreakIterator<'data, 's, Utf16> ⓘ
pub fn segment_utf16<'s>( self, input: &'s [u16], ) -> GraphemeClusterBreakIterator<'data, 's, Utf16> ⓘ
Creates a grapheme cluster break iterator for a UTF-16 string.
There are always breakpoints at 0 and the string length, or only at 0 for the empty string.
Source§impl GraphemeClusterSegmenterBorrowed<'static>
impl GraphemeClusterSegmenterBorrowed<'static>
Sourcepub const fn static_to_owned(self) -> GraphemeClusterSegmenter
pub const fn static_to_owned(self) -> GraphemeClusterSegmenter
Cheaply converts a [GraphemeClusterSegmenterBorrowed<'static>
] into a GraphemeClusterSegmenter
.
Note: Due to branching and indirection, using GraphemeClusterSegmenter
might inhibit some
compile-time optimizations that are possible with GraphemeClusterSegmenterBorrowed
.
Trait Implementations§
Source§impl<'data> Clone for GraphemeClusterSegmenterBorrowed<'data>
impl<'data> Clone for GraphemeClusterSegmenterBorrowed<'data>
Source§fn clone(&self) -> GraphemeClusterSegmenterBorrowed<'data>
fn clone(&self) -> GraphemeClusterSegmenterBorrowed<'data>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more