pub struct LedgerEntry { /* private fields */ }Expand description
Generic ledger entry for append-only platform ledgers.
Ledger keys identify the logical ledger (e.g. "audit", "decision",
"relationship", "incident", "reality"). The payload is opaque bytes
whose schema is defined by the consumer (Caelum, Digicorp).
Implementations§
Source§impl LedgerEntry
impl LedgerEntry
Sourcepub fn new(
entry_id: LedgerEntryId,
tenant_id: TenantId,
ledger_key: impl Into<String>,
payload: Vec<u8>,
timestamp: u64,
) -> Self
pub fn new( entry_id: LedgerEntryId, tenant_id: TenantId, ledger_key: impl Into<String>, payload: Vec<u8>, timestamp: u64, ) -> Self
Creates a new ledger entry.
actor_id can be set via with_actor after construction.
§Panics
Panics if ledger_key is empty.
Sourcepub fn with_actor(self, actor_id: ActorId) -> Self
pub fn with_actor(self, actor_id: ActorId) -> Self
Attaches an actor identifier, returning the modified entry.
Sourcepub fn entry_id(&self) -> LedgerEntryId
pub fn entry_id(&self) -> LedgerEntryId
Returns the entry identifier.
Sourcepub fn ledger_key(&self) -> &str
pub fn ledger_key(&self) -> &str
Returns the logical ledger key.
Trait Implementations§
Source§impl Clone for LedgerEntry
impl Clone for LedgerEntry
Source§fn clone(&self) -> LedgerEntry
fn clone(&self) -> LedgerEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LedgerEntry
impl Debug for LedgerEntry
Source§impl PartialEq for LedgerEntry
impl PartialEq for LedgerEntry
impl Eq for LedgerEntry
impl StructuralPartialEq for LedgerEntry
Auto Trait Implementations§
impl Freeze for LedgerEntry
impl RefUnwindSafe for LedgerEntry
impl Send for LedgerEntry
impl Sync for LedgerEntry
impl Unpin for LedgerEntry
impl UnsafeUnpin for LedgerEntry
impl UnwindSafe for LedgerEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more