[][src]Enum relative_path::Component

pub enum Component<'a> {
    CurDir,
    ParentDir,
    Normal(&'a str),
}

Variants

CurDir
ParentDir
Normal(&'a str)

Methods

impl<'a> Component<'a>[src]

pub fn as_str(self) -> &'a str[src]

Extracts the underlying str slice.

Examples

use relative_path::{RelativePath, Component};

let path = RelativePath::new("./tmp/../foo/bar.txt");
let components: Vec<_> = path.components().map(Component::as_str).collect();
assert_eq!(&components, &[".", "tmp", "..", "foo", "bar.txt"]);

Trait Implementations

impl<'a> Clone for Component<'a>[src]

impl<'a> Copy for Component<'a>[src]

impl<'a> Eq for Component<'a>[src]

impl<'a> Ord for Component<'a>[src]

impl<'a> PartialEq<Component<'a>> for Component<'a>[src]

impl<'a> PartialOrd<Component<'a>> for Component<'a>[src]

impl<'a> Debug for Component<'a>[src]

impl<'a> Hash for Component<'a>[src]

Auto Trait Implementations

impl<'a> Send for Component<'a>

impl<'a> Sync for Component<'a>

impl<'a> Unpin for Component<'a>

impl<'a> UnwindSafe for Component<'a>

impl<'a> RefUnwindSafe for Component<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]