Skip to main content

ProofLedger

Trait ProofLedger 

Source
pub trait ProofLedger: Send + Sync {
    // Required methods
    fn append(&self, event: &Value) -> Result<String, StoreError>;
    fn lookup(&self, event_hash: &str) -> Result<Option<Value>, StoreError>;
    fn tail(&self, limit: usize) -> Result<Vec<Value>, StoreError>;
}
Expand description

Append-only ledger of TrustForge proof events.

append returns the canonical event hash (implementation-defined; the SQLite/Postgres/MySQL backends use SHA-256 over canonical JSON). Lookup is by that hash; tail returns the most recent limit events in insertion order (oldest first within the slice).

Required Methods§

Source

fn append(&self, event: &Value) -> Result<String, StoreError>

Source

fn lookup(&self, event_hash: &str) -> Result<Option<Value>, StoreError>

Source

fn tail(&self, limit: usize) -> Result<Vec<Value>, StoreError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§