Struct canonical_path::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]

[src]

Create a canonical path by first canonicalizing the given path.

[src]

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

[src]

Return a CanonicalPath reference.

[src]

Updates self's filename ala the same method on PathBuf

[src]

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.

[src]

Consumes the CanonicalPathBuf, yielding its internal PathBuf storage.

[src]

Consumes the CanonicalPathBuf, yielding its internal OsString storage.

[src]

Return a Path reference.

[src]

Return an OsStr reference.

[src]

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

[src]

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

[src]

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

[src]

Determines whether base is a prefix of self.

[src]

Determines whether child is a suffix of self.

[src]

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

[src]

Extracts the extension of self.file_name, if possible.

[src]

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

[src]

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

[src]

Produces an iterator over the Components of a path

[src]

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

[src]

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

[src]

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.

[src]

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

[src]

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.

[src]

Does this path exist?

[src]

Is this path a file?

[src]

Is this path a directory?

Trait Implementations

impl Clone for CanonicalPathBuf
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for CanonicalPathBuf
[src]

[src]

Formats the value using the given formatter. Read more

impl PartialOrd for CanonicalPathBuf
[src]

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

impl Ord for CanonicalPathBuf
[src]

[src]

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

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl PartialEq for CanonicalPathBuf
[src]

[src]

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

[src]

This method tests for !=.

impl Eq for CanonicalPathBuf
[src]

impl Hash for CanonicalPathBuf
[src]

[src]

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

1.3.0
[src]

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

impl AsRef<Path> for CanonicalPathBuf
[src]

[src]

Performs the conversion.

impl AsRef<CanonicalPath> for CanonicalPathBuf
[src]

[src]

Performs the conversion.

impl AsRef<OsStr> for CanonicalPathBuf
[src]

[src]

Performs the conversion.

impl Borrow<CanonicalPath> for CanonicalPathBuf
[src]

[src]

Immutably borrows from an owned value. Read more

Auto Trait Implementations