pub trait WritableFileSystem:
Debug
+ Send
+ Sync {
// Required methods
fn create_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
dir: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_dir_all<'life0, 'life1, 'async_trait>(
&'life0 self,
dir: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn write<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
file: &'life1 Utf8Path,
data: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn remove_file<'life0, 'life1, 'async_trait>(
&'life0 self,
file: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn remove_dir_all<'life0, 'life1, 'async_trait>(
&'life0 self,
dir: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn read_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
dir: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
file: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn stat<'life0, 'life1, 'async_trait>(
&'life0 self,
file: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<FileMetadata>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn set_permissions<'life0, 'life1, 'async_trait>(
&'life0 self,
_path: &'life1 Utf8Path,
_perm: FilePermissions,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Required Methods§
Sourcefn create_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
dir: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
dir: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a new, empty directory at the provided path.
NOTE: If a parent of the given path doesn’t exist, this function is supposed to return an error.
To create a directory and all its missing parents at the same time, use the [create_dir_all] function.
Error: This function is supposed to return an error in the following situations, but is not limited to just these cases:
- User lacks permissions to create directory at path.
- A parent of the given path doesn’t exist. (To create a directory and all its missing parents at the same time, use the create_dir_all function.)
- Path already exists.
Sourcefn create_dir_all<'life0, 'life1, 'async_trait>(
&'life0 self,
dir: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_dir_all<'life0, 'life1, 'async_trait>(
&'life0 self,
dir: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Recursively create a directory and all of its parent components if they are missing.
Sourcefn write<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
file: &'life1 Utf8Path,
data: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
file: &'life1 Utf8Path,
data: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Write a slice as the entire contents of a file. This function will create a file if it does not exist, and will entirely replace its contents if it does.
Sourcefn remove_file<'life0, 'life1, 'async_trait>(
&'life0 self,
file: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_file<'life0, 'life1, 'async_trait>(
&'life0 self,
file: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes a file from the filesystem.
Sourcefn remove_dir_all<'life0, 'life1, 'async_trait>(
&'life0 self,
dir: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_dir_all<'life0, 'life1, 'async_trait>(
&'life0 self,
dir: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes a directory at this path, after removing all its contents. Use carefully.
Sourcefn read_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
dir: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
dir: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns a list of all files in a directory.
Sourcefn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
file: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
file: &'life1 Utf8Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read the entire contents of a file into a bytes vector.