Skip to main content

StorageLayer

Trait StorageLayer 

Source
pub trait StorageLayer {
    // Required methods
    fn insert_decision(
        &mut self,
        payload: &str,
        rules: &str,
        genesis: bool,
    ) -> Result<(), String>;
    fn insert_decision_batch(
        &mut self,
        decisions: Vec<(&str, &str)>,
        genesis: bool,
    ) -> Result<(), String>;
    fn get_latest_hash(&self) -> Result<String, String>;
    fn export_ledger(&self) -> Result<String, String>;
    fn list_decisions(&self, limit: u32, offset: u32) -> Result<String, String>;
    fn count_decisions(&self) -> Result<u64, String>;
}

Required Methods§

Source

fn insert_decision( &mut self, payload: &str, rules: &str, genesis: bool, ) -> Result<(), String>

Source

fn insert_decision_batch( &mut self, decisions: Vec<(&str, &str)>, genesis: bool, ) -> Result<(), String>

Source

fn get_latest_hash(&self) -> Result<String, String>

Source

fn export_ledger(&self) -> Result<String, String>

Source

fn list_decisions(&self, limit: u32, offset: u32) -> Result<String, String>

Source

fn count_decisions(&self) -> Result<u64, String>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl StorageLayer for SqliteStorage

Available on non-WebAssembly only.