pub trait FileSystem: Sync {
Show 16 methods
// Required methods
fn create_file(
&self,
path: &str,
attribute: FileAttribute,
size: usize,
) -> Result<()>;
fn remove_file(&self, path: &str) -> Result<()>;
fn create_directory(&self, path: &str) -> Result<()>;
fn remove_dir(&self, path: &str) -> Result<()>;
fn remove_dir_all(&self, path: &str) -> Result<()>;
fn rename_file(&self, old_path: &str, new_path: &str) -> Result<()>;
fn rename_directory(&self, old_path: &str, new_path: &str) -> Result<()>;
fn get_entry_type(&self, path: &str) -> Result<DirectoryEntryType>;
fn open_file(&self, path: &str, mode: FileOpenMode) -> Result<Box<dyn File>>;
fn open_directory(
&self,
path: &str,
mode: DirectoryOpenMode,
) -> Result<Box<dyn Directory>>;
fn commit(&self) -> Result<()>;
fn get_free_space_size(&self, path: &str) -> Result<usize>;
fn get_total_space_size(&self, path: &str) -> Result<usize>;
fn remove_children_all(&self, path: &str) -> Result<()>;
fn get_file_time_stamp_raw(&self, path: &str) -> Result<FileTimeStampRaw>;
fn query_entry(
&self,
path: &str,
query_id: QueryId,
in_buf: &[u8],
out_buf: &mut [u8],
) -> Result<()>;
}Expand description
Represents a filesystem.
Required Methods§
Sourcefn create_file(
&self,
path: &str,
attribute: FileAttribute,
size: usize,
) -> Result<()>
fn create_file( &self, path: &str, attribute: FileAttribute, size: usize, ) -> Result<()>
Creates a file.
§Arguments:
path: The file path to create.size: The initial file size.attribute: The file attribute flags.
Sourcefn remove_file(&self, path: &str) -> Result<()>
fn remove_file(&self, path: &str) -> Result<()>
Sourcefn create_directory(&self, path: &str) -> Result<()>
fn create_directory(&self, path: &str) -> Result<()>
Sourcefn remove_dir(&self, path: &str) -> Result<()>
fn remove_dir(&self, path: &str) -> Result<()>
Sourcefn remove_dir_all(&self, path: &str) -> Result<()>
fn remove_dir_all(&self, path: &str) -> Result<()>
Deletes a directory and all its children files/directories.
§Arguments:
path: The directory to recursively remove.
Sourcefn rename_file(&self, old_path: &str, new_path: &str) -> Result<()>
fn rename_file(&self, old_path: &str, new_path: &str) -> Result<()>
Sourcefn rename_directory(&self, old_path: &str, new_path: &str) -> Result<()>
fn rename_directory(&self, old_path: &str, new_path: &str) -> Result<()>
Renames a directory.
§Arguments.
old_path: The current directory path.new_path: The new directory path.