Struct Lines

struct Lines<'a>(_)

An iterator over the lines of a string, as string slices.

This struct is created with the lines method on str. See its documentation for more.

Implementations

impl<'a> Lines<'a>

fn remainder(self: &Self) -> Option<&'a str>

Returns the remaining lines of the split string.

Examples

#![feature(str_lines_remainder)]

let mut lines = "a\nb\nc\nd".lines();
assert_eq!(lines.remainder(), Some("a\nb\nc\nd"));

lines.next();
assert_eq!(lines.remainder(), Some("b\nc\nd"));

lines.by_ref().for_each(drop);
assert_eq!(lines.remainder(), None);

impl FusedIterator for Lines<'_>

impl<'a> Clone for Lines<'a>

fn clone(self: &Self) -> Lines<'a>

impl<'a> Debug for Lines<'a>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<'a> DoubleEndedIterator for Lines<'a>

fn next_back(self: &mut Self) -> Option<&'a str>

impl<'a> Freeze for Lines<'a>

impl<'a> Iterator for Lines<'a>

fn next(self: &mut Self) -> Option<&'a str>
fn size_hint(self: &Self) -> (usize, Option<usize>)
fn last(self: Self) -> Option<&'a str>

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>

impl<I> IntoIterator for Lines<'a>

fn into_iter(self: Self) -> I

impl<T> Any for Lines<'a>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Lines<'a>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Lines<'a>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Lines<'a>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Lines<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Lines<'a>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Lines<'a>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Lines<'a>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>