Struct std::old_path::posix::PathUnstable [-] [+] [src]

pub struct Path {
    // some fields omitted
}

Represents a POSIX file path

Methods

impl Path

fn new<T: BytesContainer>(path: T) -> Path

Returns a new Path from a byte vector or string

Panics

Panics the task if the vector contains a NUL.

fn new_opt<T: BytesContainer>(path: T) -> Option<Path>

Returns a new Path from a byte vector or string, if possible

fn components<'a>(&'a self) -> Components<'a>

Returns an iterator that yields each component of the path in turn. Does not distinguish between absolute and relative paths, e.g. /a/b/c and a/b/c yield the same set of components. A path of "/" yields no components. A path of "." yields one component.

fn str_components<'a>(&'a self) -> StrComponents<'a>

Returns an iterator that yields each component of the path as Option<&str>. See components() for details.

Trait Implementations

impl AsOsStr for Path

fn as_os_str(&self) -> &OsStr

impl PathExtensions for Path

fn stat(&self) -> IoResult<FileStat>

fn lstat(&self) -> IoResult<FileStat>

fn exists(&self) -> bool

fn is_file(&self) -> bool

fn is_dir(&self) -> bool

impl Debug for Path

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

impl PartialEq for Path

fn eq(&self, other: &Path) -> bool

fn ne(&self, other: &Rhs) -> bool

impl Eq for Path

impl PartialOrd for Path

fn partial_cmp(&self, other: &Path) -> Option<Ordering>

fn lt(&self, other: &Rhs) -> bool

fn le(&self, other: &Rhs) -> bool

fn gt(&self, other: &Rhs) -> bool

fn ge(&self, other: &Rhs) -> bool

impl Ord for Path

fn cmp(&self, other: &Path) -> Ordering

impl FromStr for Path

type Err = ParsePathError

fn from_str(s: &str) -> Result<Path, ParsePathError>

impl Hash for Path

fn hash<H: Hasher>(&self, state: &mut H)

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

impl BytesContainer for Path

fn container_as_bytes<'a>(&'a self) -> &'a [u8]

fn container_as_str<'a>(&'a self) -> Option<&'a str>

fn is_str(_: Option<&Self>) -> bool

impl GenericPathUnsafe for Path

unsafe fn new_unchecked<T: BytesContainer>(path: T) -> Path

unsafe fn set_filename_unchecked<T: BytesContainer>(&mut self, filename: T)

unsafe fn push_unchecked<T: BytesContainer>(&mut self, path: T)

impl GenericPath for Path

fn as_vec<'a>(&'a self) -> &'a [u8]

fn into_vec(self) -> Vec<u8>

fn dirname<'a>(&'a self) -> &'a [u8]

fn filename<'a>(&'a self) -> Option<&'a [u8]>

fn pop(&mut self) -> bool

fn root_path(&self) -> Option<Path>

fn is_absolute(&self) -> bool

fn is_ancestor_of(&self, other: &Path) -> bool

fn path_relative_from(&self, base: &Path) -> Option<Path>

fn ends_with_path(&self, child: &Path) -> bool

fn new<T: BytesContainer>(path: T) -> Self

fn new_opt<T: BytesContainer>(path: T) -> Option<Self>

fn as_str<'a>(&'a self) -> Option<&'a str>

fn display<'a>(&'a self) -> Display<'a, Self>

fn filename_display<'a>(&'a self) -> Display<'a, Self>

fn dirname_str<'a>(&'a self) -> Option<&'a str>

fn filename_str<'a>(&'a self) -> Option<&'a str>

fn filestem<'a>(&'a self) -> Option<&'a [u8]>

fn filestem_str<'a>(&'a self) -> Option<&'a str>

fn extension<'a>(&'a self) -> Option<&'a [u8]>

fn extension_str<'a>(&'a self) -> Option<&'a str>

fn set_filename<T: BytesContainer>(&mut self, filename: T)

fn set_extension<T: BytesContainer>(&mut self, extension: T)

fn with_filename<T: BytesContainer>(&self, filename: T) -> Self

fn with_extension<T: BytesContainer>(&self, extension: T) -> Self

fn dir_path(&self) -> Self

fn push<T: BytesContainer>(&mut self, path: T)

fn push_many<T: BytesContainer>(&mut self, paths: &[T])

fn join<T: BytesContainer>(&self, path: T) -> Self

fn join_many<T: BytesContainer>(&self, paths: &[T]) -> Self

fn is_relative(&self) -> bool

Derived Implementations

impl Clone for Path

fn clone(&self) -> Path

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