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 moreSource§impl<'data> Debug for LineSegmenterBorrowed<'data>
 
impl<'data> Debug for LineSegmenterBorrowed<'data>
impl<'data> Copy for LineSegmenterBorrowed<'data>
Auto Trait Implementations§
impl<'data> Freeze for LineSegmenterBorrowed<'data>
impl<'data> RefUnwindSafe for LineSegmenterBorrowed<'data>
impl<'data> Send for LineSegmenterBorrowed<'data>
impl<'data> Sync for LineSegmenterBorrowed<'data>
impl<'data> Unpin for LineSegmenterBorrowed<'data>
impl<'data> UnwindSafe for LineSegmenterBorrowed<'data>
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
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>
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>
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