pub trait FileSystem {
// Required methods
fn read_to_string(&self, path: &Path) -> Result<String>;
fn write(&self, path: &Path, contents: &[u8]) -> Result<()>;
fn create_dir_all(&self, path: &Path) -> Result<()>;
fn rename(&self, from: &Path, to: &Path) -> Result<()>;
fn exists(&self, path: &Path) -> bool;
fn open_read(&self, path: &Path) -> Result<Box<dyn BufRead>>;
fn open_write(&self, path: &Path) -> Result<Box<dyn Write>>;
}Required Methods§
fn read_to_string(&self, path: &Path) -> Result<String>
fn write(&self, path: &Path, contents: &[u8]) -> Result<()>
fn create_dir_all(&self, path: &Path) -> Result<()>
fn rename(&self, from: &Path, to: &Path) -> Result<()>
fn exists(&self, path: &Path) -> bool
fn open_read(&self, path: &Path) -> Result<Box<dyn BufRead>>
fn open_write(&self, path: &Path) -> Result<Box<dyn Write>>
Implementors§
impl FileSystem for StdFileSystem
Available on non-WebAssembly only.