Struct Lines
pub struct Lines<'a> { /* private fields */ }
An iterator over all lines in a byte string, without their terminators.
For this iterator, the only line terminators recognized are \r\n and
\n.
'a is the lifetime of the byte string being iterated over.
Implementations
impl<'a> Lines<'a>
fn as_bytes(&self) -> &'a [u8]Return a copy of the rest of the underlying bytes without affecting the iterator itself.
Examples
Basic usage:
use ; let s = b"\ foo bar\r baz"; let mut lines = s.lines; assert_eq!; assert_eq!;
Trait Implementations
impl<'a> Clone for Lines<'a>
fn clone(&self) -> Self
impl<'a> Debug for Lines<'a>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<'a> DoubleEndedIterator for Lines<'a>
fn next_back(&mut self) -> Option<Self::Item>
impl<'a> FusedIterator for Lines<'a>
impl<'a> Iterator for Lines<'a>
type Item = &'a [u8];fn next(&mut self) -> Option<&'a [u8]>
Auto Trait Implementations
impl<'a> Freeze for Lines<'a>
impl<'a> RefUnwindSafe for Lines<'a>
impl<'a> Send for Lines<'a>
impl<'a> Sync for Lines<'a>
impl<'a> Unpin for Lines<'a>
impl<'a> UnsafeUnpin for Lines<'a>
impl<'a> UnwindSafe for Lines<'a>
Blanket Implementations
impl<I> IntoIterator for Lines<'a>
where
I: Iterator,
type Item = <I as Iterator>::Item;type IntoIter = I;fn into_iter(self) -> I
impl<T> Any for Lines<'a>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Lines<'a>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Lines<'a>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Lines<'a>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Lines<'a>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Lines<'a>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Lines<'a>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Lines<'a>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Lines<'a>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>