pub trait WorkspaceBackend:
Any
+ Send
+ Sync {
// Required methods
fn as_any(&self) -> &dyn Any;
fn list_files(&self, base: &str, glob: &str) -> Result<Vec<String>>;
fn read_text(&self, path: &str) -> Result<String>;
fn read_bytes(&self, path: &str) -> Result<Vec<u8>>;
fn write_text(
&self,
path: &str,
content: &str,
append: bool,
) -> Result<usize>;
fn file_info(&self, path: &str) -> Result<Option<FileInfo>>;
fn exists(&self, path: &str) -> bool;
fn is_file(&self, path: &str) -> bool;
fn mkdir(&self, path: &str) -> Result<()>;
}Required Methods§
fn as_any(&self) -> &dyn Any
fn list_files(&self, base: &str, glob: &str) -> Result<Vec<String>>
fn read_text(&self, path: &str) -> Result<String>
fn read_bytes(&self, path: &str) -> Result<Vec<u8>>
fn write_text(&self, path: &str, content: &str, append: bool) -> Result<usize>
fn file_info(&self, path: &str) -> Result<Option<FileInfo>>
fn exists(&self, path: &str) -> bool
fn is_file(&self, path: &str) -> bool
fn mkdir(&self, path: &str) -> Result<()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".