Skip to main content

Backend

Trait Backend 

Source
pub trait Backend {
    // Required methods
    fn load(&self, prj: &Project) -> Result<(Store, Vec<String>)>;
    fn flush(&self, prj: &Project, store: Store) -> Result<()>;
    fn load_docs(&self, prj: &Project) -> (Vec<Doc>, Vec<String>);
}
Expand description

A durable storage medium for the corpus.

Required Methods§

Source

fn load(&self, prj: &Project) -> Result<(Store, Vec<String>)>

Load the durable corpus into a fresh working Store, plus non-fatal parse errors (unparsable documents are skipped, not fatal).

Source

fn flush(&self, prj: &Project, store: Store) -> Result<()>

Persist the store’s net changes: write changed documents, delete removed ones, relocate moved ones, and rewrite the retired-id ledger.

Source

fn load_docs(&self, prj: &Project) -> (Vec<Doc>, Vec<String>)

Read and parse every durable document (raw, without building a store), returning parsed docs + non-fatal parse errors. Used by read-only passes (stats, history) and the TUI board.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§