pub trait PluginFs: Send + Sync {
// Required methods
fn read_file(&self, path: &Path) -> Result<Vec<u8>, PluginError>;
fn write_file(&self, path: &Path, content: &[u8]) -> Result<(), PluginError>;
fn read_dir(&self, path: &Path) -> Result<Vec<FsEntry>, PluginError>;
fn exists(&self, path: &Path) -> bool;
fn create_dir_all(&self, path: &Path) -> Result<(), PluginError>;
fn remove_file(&self, path: &Path) -> Result<(), PluginError>;
fn remove_dir_all(&self, path: &Path) -> Result<(), PluginError>;
}Required Methods§
fn read_file(&self, path: &Path) -> Result<Vec<u8>, PluginError>
fn write_file(&self, path: &Path, content: &[u8]) -> Result<(), PluginError>
fn read_dir(&self, path: &Path) -> Result<Vec<FsEntry>, PluginError>
fn exists(&self, path: &Path) -> bool
fn create_dir_all(&self, path: &Path) -> Result<(), PluginError>
fn remove_file(&self, path: &Path) -> Result<(), PluginError>
fn remove_dir_all(&self, path: &Path) -> Result<(), PluginError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".