Skip to main content

Backend

Trait Backend 

Source
pub trait Backend: Send + Sync {
    // Required methods
    fn ls_children(&self, path: &VfsPath, limit: usize) -> Result<Vec<DirEntry>>;
    fn ls_cursor(&self, path: &VfsPath, limit: usize) -> Result<Vec<DirEntry>>;
    fn read_json(&self, path: &VfsPath) -> Result<Value>;
    fn read_debug(&self, path: &VfsPath) -> Result<String>;
    fn read_bcs(&self, path: &VfsPath) -> Result<Vec<u8>>;
    fn delete(&self, path: &VfsPath) -> Result<()>;
}

Required Methods§

Source

fn ls_children(&self, path: &VfsPath, limit: usize) -> Result<Vec<DirEntry>>

List the children of path (normal directory listing).

Source

fn ls_cursor(&self, path: &VfsPath, limit: usize) -> Result<Vec<DirEntry>>

List starting from path as a cursor into the parent namespace. Used for ls /checkpoints/seq/1234 which means “list 30 from seq 1234”.

Source

fn read_json(&self, path: &VfsPath) -> Result<Value>

Return the JSON representation of the entity at path.

Source

fn read_debug(&self, path: &VfsPath) -> Result<String>

Return the Rust {:#?} debug representation of the entity at path.

Source

fn read_bcs(&self, path: &VfsPath) -> Result<Vec<u8>>

Return the raw BCS bytes of the entity at path.

Source

fn delete(&self, path: &VfsPath) -> Result<()>

Delete the entity at path. Destructive and permanent.

Implementors§