Skip to main content

WorkspaceBackend

Trait WorkspaceBackend 

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

Source

fn as_any(&self) -> &dyn Any

Source

fn list_files(&self, base: &str, glob: &str) -> Result<Vec<String>>

Source

fn read_text(&self, path: &str) -> Result<String>

Source

fn read_bytes(&self, path: &str) -> Result<Vec<u8>>

Source

fn write_text(&self, path: &str, content: &str, append: bool) -> Result<usize>

Source

fn file_info(&self, path: &str) -> Result<Option<FileInfo>>

Source

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

Source

fn is_file(&self, path: &str) -> bool

Source

fn mkdir(&self, path: &str) -> Result<()>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§