Skip to main content

AsgLedgerStore

Struct AsgLedgerStore 

Source
pub struct AsgLedgerStore<'a> {
    pub repo: &'a Repository,
    pub fts: Option<&'a SearchFtsDb>,
}

Fields§

§repo: &'a Repository§fts: Option<&'a SearchFtsDb>

Borrowed FTS connection from the owning Engine. When Some, enables the SQLite write-through cache: list_entries reads from SQLite when populated, append_entry writes to SQLite after the git commit. No Connection::open on every method call.

Implementations§

Source§

impl<'a> AsgLedgerStore<'a>

Source

pub fn new(repo: &'a Repository) -> Self

Construct without SQLite caching (tests, internal engine calls).

Source

pub fn from_engine(engine: &'a Engine) -> Self

Convenience: borrow the FTS connection already open in engine.

Trait Implementations§

Source§

impl<'a> LedgerStore for AsgLedgerStore<'a>

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.
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.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for AsgLedgerStore<'a>

§

impl<'a> !Send for AsgLedgerStore<'a>

§

impl<'a> !Sync for AsgLedgerStore<'a>

§

impl<'a> !UnwindSafe for AsgLedgerStore<'a>

§

impl<'a> Freeze for AsgLedgerStore<'a>

§

impl<'a> Unpin for AsgLedgerStore<'a>

§

impl<'a> UnsafeUnpin for AsgLedgerStore<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.