Enum relative_path::Component [−][src]
pub enum Component<'a> { CurDir, ParentDir, Normal(&'a str), }
A single path component.
Accessed using the RelativePath::components iterator.
Examples
use relative_path::{Component, RelativePath}; let path = RelativePath::new("foo/../bar/./baz"); let mut it = path.components(); assert_eq!(Some(Component::Normal("foo")), it.next()); assert_eq!(Some(Component::ParentDir), it.next()); assert_eq!(Some(Component::Normal("bar")), it.next()); assert_eq!(Some(Component::CurDir), it.next()); assert_eq!(Some(Component::Normal("baz")), it.next()); assert_eq!(None, it.next());
Variants
The current directory .
.
The parent directory ..
.
Normal(&'a str)
A normal path component as a string.
Implementations
Trait Implementations
impl<'a> PartialOrd<Component<'a>> for Component<'a>
[src]
impl<'a> PartialOrd<Component<'a>> for Component<'a>
[src]fn partial_cmp(&self, other: &Component<'a>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl<'a> StructuralEq for Component<'a>
[src]
impl<'a> StructuralEq for Component<'a>
[src]impl<'a> StructuralPartialEq for Component<'a>
[src]
impl<'a> StructuralPartialEq for Component<'a>
[src]Auto Trait Implementations
impl<'a> RefUnwindSafe for Component<'a>
impl<'a> RefUnwindSafe for Component<'a>
impl<'a> UnwindSafe for Component<'a>
impl<'a> UnwindSafe for Component<'a>