Skip to main content

Storage

Trait Storage 

Source
pub trait Storage: Send + Sync {
    // Required methods
    fn read(&self, path: &Path) -> Result<String>;
    fn write(&self, path: &Path, content: &str) -> Result<()>;
    fn delete(&self, path: &Path) -> Result<()>;
    fn list(&self, dir: &Path) -> Result<Vec<PathBuf>>;
    fn create_dir_all(&self, path: &Path) -> Result<()>;
    fn exists(&self, path: &Path) -> bool;
    fn rename(&self, from: &Path, to: &Path) -> Result<()>;
}
Expand description

Abstraction over filesystem operations used by the memory system.

Required Methods§

Source

fn read(&self, path: &Path) -> Result<String>

Source

fn write(&self, path: &Path, content: &str) -> Result<()>

Source

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

Source

fn list(&self, dir: &Path) -> Result<Vec<PathBuf>>

Source

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

Source

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

Source

fn rename(&self, from: &Path, to: &Path) -> Result<()>

Implementors§