Struct abscissa::CanonicalPathBuf[][src]

pub struct CanonicalPathBuf(_);

An owned path on the filesystem which is guaranteed to be canonical.

More specifically: it is at least guaranteed to be canonical at the time it is created. There are potential TOCTTOU problems if the underlying filesystem structure changes after path canonicalization.

Methods

impl CanonicalPathBuf
[src]

Create a canonical path by first canonicalizing the given path.

Create a canonical path, returning error if the supplied path is not canonical.

Return a CanonicalPath reference.

Updates self's filename ala the same method on PathBuf

Updates self.extension to extension.

Returns false and does nothing if self.file_name is None, returns true and updates the extension otherwise. If self.extension is None, the extension is added; otherwise it is replaced.

Consumes the CanonicalPathBuf, yielding its internal PathBuf storage.

Consumes the CanonicalPathBuf, yielding its internal OsString storage.

Return a Path reference.

Return an OsStr reference.

Yields a &str slice if the path is valid unicode.

Return a canonical parent path of this path, or io::Error if the path is the root directory or another canonicalization error occurs.

Returns the final component of the path, if there is one.

Determines whether base is a prefix of self.

Determines whether child is a suffix of self.

Extracts the stem (non-extension) portion of self.file_name.

Extracts the extension of self.file_name, if possible.

Creates an owned CanonicalPathBuf like self but with the given file name.

Creates an owned CanonicalPathBuf like self but with the given extension.

Important traits for Components<'a>

Produces an iterator over the Components of a path

Important traits for Iter<'a>

Produces an iterator over the path's components viewed as OsStr slices.

Returns an object that implements Display for safely printing paths that may contain non-Unicode data.

Queries the file system to get information about a file, directory, etc.

Unlike the std version of this method, it will not follow symlinks, since as a canonical path we should be symlink-free.

Join a path onto a canonical path, returning a CanonicalPathBuf.

Returns an iterator over the entries within a directory.

The iterator will yield instances of io::Result. New errors may be encountered after an iterator is initially constructed.

This is an alias to fs::read_dir.

Does this path exist?

Is this path a file?

Is this path a directory?

Trait Implementations

impl PartialOrd<CanonicalPathBuf> for CanonicalPathBuf
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Hash for CanonicalPathBuf
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Borrow<CanonicalPath> for CanonicalPathBuf
[src]

Immutably borrows from an owned value. Read more

impl Clone for CanonicalPathBuf
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for CanonicalPathBuf
[src]

Formats the value using the given formatter. Read more

impl Ord for CanonicalPathBuf
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Eq for CanonicalPathBuf
[src]

impl AsRef<CanonicalPath> for CanonicalPathBuf
[src]

Performs the conversion.

impl AsRef<OsStr> for CanonicalPathBuf
[src]

Performs the conversion.

impl AsRef<Path> for CanonicalPathBuf
[src]

Performs the conversion.

impl PartialEq<CanonicalPathBuf> for CanonicalPathBuf
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations