Skip to main content

RunStore

Trait RunStore 

Source
pub trait RunStore:
    Debug
    + Send
    + Sync {
    // Required methods
    fn ledgers(&self) -> Vec<StoredLedger>;
    fn write_ledger(&self, key: &str, text: &str) -> Result<()>;
    fn remove_ledger(&self, key: &str) -> Result<()>;
    fn read_history(&self, vm_id: &str) -> Result<String>;
    fn append_history(&self, vm_id: &str, line: &str) -> Result<()>;
}
Expand description

Durable storage used by the run ledger and history policies.

Writes report errors here; the policies deliberately swallow them on teardown so housekeeping never replaces a command’s real outcome. Keys are opaque store identifiers.

Required Methods§

Source

fn ledgers(&self) -> Vec<StoredLedger>

Lists every ledger, including an unreadable document as text: None.

Source

fn write_ledger(&self, key: &str, text: &str) -> Result<()>

Replaces a ledger while keeping history separate.

Source

fn remove_ledger(&self, key: &str) -> Result<()>

Removes a ledger. The caller has decided whether its resources are resolved.

Source

fn read_history(&self, vm_id: &str) -> Result<String>

Reads the complete history text, preserving line order and malformed lines.

Source

fn append_history(&self, vm_id: &str, line: &str) -> Result<()>

Appends one serialized record and a newline, without replacing earlier bytes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§