pub struct VfsPath { /* private fields */ }
Expand description

A virtual filesystem path, identifying a single file or directory in this virtual filesystem

Implementations

Creates a root path for the given filesystem

Returns the string representation of this path

Appends a path segment to this path, returning the result

Iterates over all entries of this directory path

Creates the directory at this path

Note that the parent directory must exist.

Creates the directory at this path, also creating parent directories as necessary

Opens the file at this path for reading

Creates a file at this path for writing, overwriting any existing file

Opens the file at this path for appending

Removes the file at this path

Removes the directory at this path

The directory must be empty.

Ensures that the directory at this path is removed, recursively deleting all contents if necessary

Returns successfully if directory does not exist

Returns the file metadata for the file at this path

Returns true if a file or directory exists at this path, false otherwise

Returns the filename portion of this path

Returns the extension portion of this path

Returns the parent path of this portion of this path

Returns None if this is a root path

Recursively iterates over all the directories and files at this path

Directories are visited before their children

Note that the iterator items can contain errors, usually when directories are removed during the iteration. The returned paths may also point to non-existant files if there is concurrent removal.

Also note that loops in the file system hierarchy may cause this iterator to never terminate.

Reads a complete file to a string

Returns an error if the file does not exist or is not valid UTF-8

Copies a file to a new destination

The destination must not exist, but its parent directory must

Moves or renames a file to a new destination

The destination must not exist, but its parent directory must

Copies a directory to a new destination, recursively

The destination must not exist, but the parent directory must

Returns the number of files copied

Returns true if the path exists and is pointing at a regular file, otherwise returns false.

Note that this call may fail if the file’s existence cannot be determined or the metadata can not be retrieved

Returns true if the path exists and is pointing at a directory, otherwise returns false.

Note that this call may fail if the directory’s existence cannot be determined or the metadata can not be retrieved

Moves a directory to a new destination, including subdirectories and files

The destination must not exist, but its parent directory must

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.