pub trait Ledger {
// Required methods
fn create(
&self,
ref_prefix: &str,
strategy: &IdStrategy<'_>,
mutations: &[Mutation<'_>],
message: &str,
author: Option<&Signature<'_>>,
) -> Result<LedgerEntry, Error>;
fn read(&self, ref_name: &str) -> Result<LedgerEntry, Error>;
fn update(
&self,
ref_name: &str,
mutations: &[Mutation<'_>],
message: &str,
) -> Result<LedgerEntry, Error>;
fn list(&self, ref_prefix: &str) -> Result<Vec<String>, Error>;
fn history(&self, ref_name: &str) -> Result<Vec<Oid>, Error>;
}Expand description
Core ledger operations.
Required Methods§
Sourcefn create(
&self,
ref_prefix: &str,
strategy: &IdStrategy<'_>,
mutations: &[Mutation<'_>],
message: &str,
author: Option<&Signature<'_>>,
) -> Result<LedgerEntry, Error>
fn create( &self, ref_prefix: &str, strategy: &IdStrategy<'_>, mutations: &[Mutation<'_>], message: &str, author: Option<&Signature<'_>>, ) -> Result<LedgerEntry, Error>
Create a new record under ref_prefix.
author overrides the commit author; when None, self.signature() is
used for both author and committer.
Sourcefn read(&self, ref_name: &str) -> Result<LedgerEntry, Error>
fn read(&self, ref_name: &str) -> Result<LedgerEntry, Error>
Read an existing record by its full ref name.
Sourcefn update(
&self,
ref_name: &str,
mutations: &[Mutation<'_>],
message: &str,
) -> Result<LedgerEntry, Error>
fn update( &self, ref_name: &str, mutations: &[Mutation<'_>], message: &str, ) -> Result<LedgerEntry, Error>
Update an existing record by applying mutations.