Skip to main content

LedgerStore

Trait LedgerStore 

Source
pub trait LedgerStore {
    // Required methods
    fn append_entry(
        &self,
        ref_name: &str,
        entry: &LedgerEntry,
        agent_id: &str,
    ) -> Result<()>;
    fn list_entries_with_superseded(
        &self,
        ref_name: &str,
        symbol_id: &str,
    ) -> Result<Vec<LedgerEntry>>;

    // Provided methods
    fn list_entries(
        &self,
        ref_name: &str,
        symbol_id: &str,
    ) -> Result<Vec<LedgerEntry>> { ... }
    fn approve_entry(
        &self,
        _ref_name: &str,
        _entry_id: &str,
        _approver_id: &str,
        _approver_kind: &str,
        _message: Option<&str>,
        _agent_id: &str,
    ) -> Result<ApprovalOutcome> { ... }
    fn reject_entry(
        &self,
        _ref_name: &str,
        _entry_id: &str,
        _reviewer_id: &str,
        _reviewer_kind: &str,
        _reason: &str,
        _agent_id: &str,
    ) -> Result<ReviewOutcome> { ... }
    fn withdraw_entry(
        &self,
        _ref_name: &str,
        _entry_id: &str,
        _author_id: &str,
        _agent_id: &str,
    ) -> Result<ReviewOutcome> { ... }
}

Required Methods§

Source

fn append_entry( &self, ref_name: &str, entry: &LedgerEntry, agent_id: &str, ) -> Result<()>

Source

fn list_entries_with_superseded( &self, ref_name: &str, symbol_id: &str, ) -> Result<Vec<LedgerEntry>>

Full list including superseded entries.

Provided Methods§

Source

fn list_entries( &self, ref_name: &str, symbol_id: &str, ) -> Result<Vec<LedgerEntry>>

List entries for a symbol, newest first. By default, entries that have been superseded by a later entry are filtered out.

Source

fn approve_entry( &self, _ref_name: &str, _entry_id: &str, _approver_id: &str, _approver_kind: &str, _message: Option<&str>, _agent_id: &str, ) -> Result<ApprovalOutcome>

Approve an awaiting-approval entry. The OSS default returns a “commercial feature” error — the real implementation lives in the agentstatedeveloper-ratify crate (Team-tier).

Source

fn reject_entry( &self, _ref_name: &str, _entry_id: &str, _reviewer_id: &str, _reviewer_kind: &str, _reason: &str, _agent_id: &str, ) -> Result<ReviewOutcome>

Reject an awaiting-approval entry. See approve_entry — OSS default errors; real impl in agentstatedeveloper-ratify.

Source

fn withdraw_entry( &self, _ref_name: &str, _entry_id: &str, _author_id: &str, _agent_id: &str, ) -> Result<ReviewOutcome>

Withdraw an awaiting-approval entry. See approve_entry — OSS default errors; real impl in agentstatedeveloper-ratify.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§