Skip to main content

PluginFs

Trait PluginFs 

Source
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§

Source

fn read_file(&self, path: &Path) -> Result<Vec<u8>, PluginError>

Source

fn write_file(&self, path: &Path, content: &[u8]) -> Result<(), PluginError>

Source

fn read_dir(&self, path: &Path) -> Result<Vec<FsEntry>, PluginError>

Source

fn exists(&self, path: &Path) -> bool

Source

fn create_dir_all(&self, path: &Path) -> Result<(), PluginError>

Source

fn remove_file(&self, path: &Path) -> Result<(), PluginError>

Source

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".

Implementors§