pub struct LineSegmenterBorrowed<'data> { /* private fields */ }Expand description
Segments a string into lines (borrowed version).
See LineSegmenter for examples.
Implementations§
Source§impl<'data> LineSegmenterBorrowed<'data>
impl<'data> LineSegmenterBorrowed<'data>
Sourcepub fn segment_str<'s>(
self,
input: &'s str,
) -> LineBreakIterator<'data, 's, Utf8> ⓘ
pub fn segment_str<'s>( self, input: &'s str, ) -> LineBreakIterator<'data, 's, Utf8> ⓘ
Creates a line break iterator for an str (a UTF-8 string).
There are always breakpoints at 0 and the string length, or only at 0 for the empty string.
Sourcepub fn segment_utf8<'s>(
self,
input: &'s [u8],
) -> LineBreakIterator<'data, 's, PotentiallyIllFormedUtf8> ⓘ
pub fn segment_utf8<'s>( self, input: &'s [u8], ) -> LineBreakIterator<'data, 's, PotentiallyIllFormedUtf8> ⓘ
Creates a line 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],
) -> LineBreakIterator<'data, 's, Latin1> ⓘ
pub fn segment_latin1<'s>( self, input: &'s [u8], ) -> LineBreakIterator<'data, 's, Latin1> ⓘ
Creates a line 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],
) -> LineBreakIterator<'data, 's, Utf16> ⓘ
pub fn segment_utf16<'s>( self, input: &'s [u16], ) -> LineBreakIterator<'data, 's, Utf16> ⓘ
Creates a line 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 LineSegmenterBorrowed<'static>
impl LineSegmenterBorrowed<'static>
Sourcepub fn static_to_owned(self) -> LineSegmenter
pub fn static_to_owned(self) -> LineSegmenter
Cheaply converts a LineSegmenterBorrowed<'static> into a LineSegmenter.
Note: Due to branching and indirection, using LineSegmenter might inhibit some
compile-time optimizations that are possible with LineSegmenterBorrowed.
Trait Implementations§
Source§impl<'data> Clone for LineSegmenterBorrowed<'data>
impl<'data> Clone for LineSegmenterBorrowed<'data>
Source§fn clone(&self) -> LineSegmenterBorrowed<'data>
fn clone(&self) -> LineSegmenterBorrowed<'data>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more