Enum std::path::Component [] [src]

pub enum Component<'a> {
    Prefix(PrefixComponent<'a>),
    RootDir,
    CurDir,
    ParentDir,
    Normal(&'a OsStr),
}

A single component of a path.

See the module documentation for an in-depth explanation of components and their role in the API.

Variants

Prefix

A Windows path prefix, e.g. C: or \server\share.

Does not occur on Unix.

RootDir

The root directory component, appears after any prefix and before anything else

CurDir

A reference to the current directory, i.e. .

ParentDir

A reference to the parent directory, i.e. ..

Normal

A normal component, i.e. a and b in a/b

Methods

impl<'a> Component<'a>

fn as_os_str(self) -> &'a OsStr

Extracts the underlying OsStr slice

Trait Implementations

impl<'a> AsRef<OsStr> for Component<'a>

fn as_ref(&self) -> &OsStr

Derived Implementations

impl<'a> Debug for Component<'a>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<'a> Hash for Component<'a>

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl<'a> Ord for Component<'a>

fn cmp(&self, __arg_0: &Component<'a>) -> Ordering

impl<'a> PartialOrd for Component<'a>

fn partial_cmp(&self, __arg_0: &Component<'a>) -> Option<Ordering>

fn lt(&self, __arg_0: &Component<'a>) -> bool

fn le(&self, __arg_0: &Component<'a>) -> bool

fn gt(&self, __arg_0: &Component<'a>) -> bool

fn ge(&self, __arg_0: &Component<'a>) -> bool

impl<'a> Eq for Component<'a>

impl<'a> PartialEq for Component<'a>

fn eq(&self, __arg_0: &Component<'a>) -> bool

fn ne(&self, __arg_0: &Component<'a>) -> bool

impl<'a> Clone for Component<'a>

fn clone(&self) -> Component<'a>

fn clone_from(&mut self, source: &Self)

impl<'a> Copy for Component<'a>