pub struct FolderPath { /* private fields */ }Expand description
A folder path.
Implementations§
Source§impl FolderPath
Delete Files
impl FolderPath
Delete Files
Sourcepub fn delete_files(&self) -> Result<(), Error>
pub fn delete_files(&self) -> Result<(), Error>
Deletes all files in the folder recursively.
Source§impl FolderPath
List Files
impl FolderPath
List Files
Sourcepub fn list_files(&self) -> Result<ListFilesOp, Error>
pub fn list_files(&self) -> Result<ListFilesOp, Error>
Creates a list-files operation on the folder.
The files will be returned in lexicographical order.
Sourcepub fn list_files_unsorted(&self) -> Result<ListFilesOp, Error>
pub fn list_files_unsorted(&self) -> Result<ListFilesOp, Error>
Creates a list-files operation on the folder where the files may be unsorted.
Source§impl FolderPath
List Files as Vec
impl FolderPath
List Files as Vec
Sourcepub fn list_files_as_vec(&self) -> Result<Vec<FilePath>, Error>
pub fn list_files_as_vec(&self) -> Result<Vec<FilePath>, Error>
Lists the files in the folder as a Vec<FilePath> sorted in lexicographical order.
Returns Ok(sorted_files).
Sourcepub fn list_files_as_vec_unsorted(&self) -> Result<Vec<FilePath>, Error>
pub fn list_files_as_vec_unsorted(&self) -> Result<Vec<FilePath>, Error>
Lists the files as a Vec<FilePath>.
Returns Ok(files).
Source§impl FolderPath
Construction
impl FolderPath
Construction
Sourcepub unsafe fn new(path: StoragePath) -> Self
pub unsafe fn new(path: StoragePath) -> Self
Source§impl FolderPath
Storage Path
impl FolderPath
Storage Path
Sourcepub fn path(&self) -> &StoragePath
pub fn path(&self) -> &StoragePath
Gets the storage path.
Sourcepub fn to_path(self) -> StoragePath
pub fn to_path(self) -> StoragePath
Converts the folder path to a storage path.
Source§impl FolderPath
Current Working Directory
impl FolderPath
Current Working Directory
Sourcepub fn current_working_directory() -> Result<Self, Error>
pub fn current_working_directory() -> Result<Self, Error>
Gets the current working directory.
Source§impl FolderPath
Roots
impl FolderPath
Roots
Source§impl FolderPath
Clone
impl FolderPath
Clone
Sourcepub fn clone_with_extra_capacity(&self, extra_capacity: usize) -> Self
pub fn clone_with_extra_capacity(&self, extra_capacity: usize) -> Self
Clones the path with the extra capacity.
Methods from Deref<Target = StoragePath>§
Sourcepub fn file_separator(&self) -> char
pub fn file_separator(&self) -> char
Gets the file-separator.
Sourcepub fn clone_to_file(&self) -> Result<FilePath, Error>
pub fn clone_to_file(&self) -> Result<FilePath, Error>
Clones the path and converts it to a file path.
Returns Err if the path is not a file path.
Sourcepub fn clone_to_folder(&self) -> Result<FolderPath, Error>
pub fn clone_to_folder(&self) -> Result<FolderPath, Error>
Clones the path and converts it to a folder path.
Returns Err if the path is not a folder path.
Sourcepub fn clone_with_extra_capacity(&self, extra_capacity: usize) -> Self
pub fn clone_with_extra_capacity(&self, extra_capacity: usize) -> Self
Clones the path with the extra capacity.
Sourcepub fn clone_append<S>(&self, string: S) -> Self
pub fn clone_append<S>(&self, string: S) -> Self
Clones the path and appends the string.
The result is the same as path.clone().with_appended(s) but with a single allocation.
Sourcepub fn clone_make_folder(&self) -> FolderPath
pub fn clone_make_folder(&self) -> FolderPath
Clones the path and makes the path a folder.
Returns the path as is if it is already a folder, otherwise appends a file-separator.
Sourcepub fn relative_path(&self) -> &str
pub fn relative_path(&self) -> &str
Gets the relative path (the portion after the base).
Sourcepub fn is_local_path(&self) -> bool
pub fn is_local_path(&self) -> bool
Checks if the path is a local path.
Sourcepub fn is_unix_path(&self) -> bool
pub fn is_unix_path(&self) -> bool
Checks if the path is a Unix path.
Sourcepub fn is_windows_path(&self) -> bool
pub fn is_windows_path(&self) -> bool
Checks if the path is a Windows path.
Trait Implementations§
Source§impl AsRef<FolderPath> for FolderPath
impl AsRef<FolderPath> for FolderPath
Source§fn as_ref(&self) -> &FolderPath
fn as_ref(&self) -> &FolderPath
Source§impl AsRef<OsStr> for FolderPath
impl AsRef<OsStr> for FolderPath
Source§impl AsRef<Path> for FolderPath
impl AsRef<Path> for FolderPath
Source§impl AsRef<str> for FolderPath
impl AsRef<str> for FolderPath
Source§impl Clone for FolderPath
impl Clone for FolderPath
Source§fn clone(&self) -> FolderPath
fn clone(&self) -> FolderPath
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FolderPath
impl Debug for FolderPath
Source§impl Deref for FolderPath
impl Deref for FolderPath
Source§type Target = StoragePath
type Target = StoragePath
Source§fn deref(&self) -> &StoragePath
fn deref(&self) -> &StoragePath
Source§impl Display for FolderPath
impl Display for FolderPath
impl Eq for FolderPath
Source§impl From<FolderPath> for StoragePath
impl From<FolderPath> for StoragePath
Source§fn from(path: FolderPath) -> Self
fn from(path: FolderPath) -> Self
Source§impl Hash for FolderPath
impl Hash for FolderPath
Source§impl Ord for FolderPath
impl Ord for FolderPath
Source§fn cmp(&self, other: &FolderPath) -> Ordering
fn cmp(&self, other: &FolderPath) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for FolderPath
impl PartialEq for FolderPath
Source§fn eq(&self, other: &FolderPath) -> bool
fn eq(&self, other: &FolderPath) -> bool
self and other values to be equal, and is used by ==.