Struct Iter

struct Iter<'a> { ... }

An iterator over the Components of a Path, as OsStr slices.

This struct is created by the iter method on Path. See its documentation for more.

Implementations

impl<'a> Iter<'a>

fn as_path(self: &Self) -> &'a Path

Extracts a slice corresponding to the portion of the path remaining for iteration.

Examples

use std::path::Path;

let mut iter = Path::new("/tmp/foo/bar.txt").iter();
iter.next();
iter.next();

assert_eq!(Path::new("foo/bar.txt"), iter.as_path());

impl AsRef for Iter<'_>

fn as_ref(self: &Self) -> &Path

impl AsRef for Iter<'_>

fn as_ref(self: &Self) -> &OsStr

impl Debug for Iter<'_>

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

impl FusedIterator for Iter<'_>

impl<'a> Clone for Iter<'a>

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

impl<'a> DoubleEndedIterator for Iter<'a>

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

impl<'a> Freeze for Iter<'a>

impl<'a> Iterator for Iter<'a>

fn next(self: &mut Self) -> Option<&'a OsStr>

impl<'a> RefUnwindSafe for Iter<'a>

impl<'a> Send for Iter<'a>

impl<'a> Sync for Iter<'a>

impl<'a> Unpin for Iter<'a>

impl<'a> UnwindSafe for Iter<'a>

impl<I> IntoIterator for Iter<'a>

fn into_iter(self: Self) -> I

impl<T> Any for Iter<'a>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Iter<'a>

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

impl<T> BorrowMut for Iter<'a>

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

impl<T> CloneToUninit for Iter<'a>

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

impl<T> From for Iter<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Iter<'a>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Iter<'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 Iter<'a>

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

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

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