Skip to main content

Disk

Trait Disk 

Source
pub trait Disk {
    // Required methods
    fn read(&self, path: &Path) -> Option<String>;
    fn exists(&self, path: &Path) -> bool;
    fn list_md(&self, dir: &Path) -> Vec<PathBuf>;
}
Expand description

The read surface the [Vfs] overlays writes on top of.

Required Methods§

Source

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

The file’s text, or None if it does not exist / is unreadable.

Source

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

Whether a file exists at path.

Source

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

The .md files directly inside dir (non-recursive).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§