pub trait ContainedFs: Send + Sync {
// Required methods
fn walk(&self, path: &str) -> Result<FsHandle, FsError>;
fn open(&self, path: &str, mode: OpenMode) -> Result<File, FsError>;
fn create(&self, path: &str, mode: OpenMode) -> Result<File, FsError>;
fn mkdir(&self, path: &str) -> Result<(), FsError>;
fn mkdir_all(&self, path: &str) -> Result<(), FsError>;
fn stat(&self, path: &str) -> Result<Stat, FsError>;
fn rename(&self, src: &str, dst: &str) -> Result<(), FsError>;
fn remove(&self, path: &str) -> Result<(), FsError>;
fn readdir(&self, path: &str) -> Result<Vec<DirEntry>, FsError>;
fn copy(&self, src: &str, dst: &str) -> Result<(), FsError>;
}Expand description
Trait abstracting path-contained filesystem operations.
All paths passed to methods are relative to the contained root
(forward-slash-separated &str, 9P convention).
Implementations ensure no path can escape the root directory.
Required Methods§
Sourcefn walk(&self, path: &str) -> Result<FsHandle, FsError>
fn walk(&self, path: &str) -> Result<FsHandle, FsError>
Resolve a relative path and return an FsHandle for 9P walk state.
Sourcefn open(&self, path: &str, mode: OpenMode) -> Result<File, FsError>
fn open(&self, path: &str, mode: OpenMode) -> Result<File, FsError>
Open an existing file relative to the root.
Sourcefn create(&self, path: &str, mode: OpenMode) -> Result<File, FsError>
fn create(&self, path: &str, mode: OpenMode) -> Result<File, FsError>
Create a file relative to the root (implies open).