pub struct AppendTransaction { /* private fields */ }Expand description
Atomic append request guarded by the caller’s expected session tail.
Implementations§
Source§impl AppendTransaction
impl AppendTransaction
Sourcepub fn new(
session_id: SessionId,
expected_sequence: Option<SessionSequence>,
records: Vec<RecordEnvelope>,
) -> Self
pub fn new( session_id: SessionId, expected_sequence: Option<SessionSequence>, records: Vec<RecordEnvelope>, ) -> Self
Creates a canonical-record append transaction.
Sourcepub const fn with_expected_journal_revision(self, revision: u64) -> Self
pub const fn with_expected_journal_revision(self, revision: u64) -> Self
Guards typed side-journal writes with the expected current revision.
Sourcepub fn with_approval_artifacts(
self,
entries: impl IntoIterator<Item = ApprovalArtifactEntry>,
) -> Self
pub fn with_approval_artifacts( self, entries: impl IntoIterator<Item = ApprovalArtifactEntry>, ) -> Self
Attaches typed approval artifacts committed with canonical transitions.
Sourcepub fn with_grant_entries(
self,
entries: impl IntoIterator<Item = GrantJournalEntry>,
) -> Self
pub fn with_grant_entries( self, entries: impl IntoIterator<Item = GrantJournalEntry>, ) -> Self
Attaches append-only grant journal facts committed with this transaction.
Sourcepub const fn session_id(&self) -> SessionId
pub const fn session_id(&self) -> SessionId
Returns the target session.
Sourcepub const fn expected_sequence(&self) -> Option<SessionSequence>
pub const fn expected_sequence(&self) -> Option<SessionSequence>
Returns expected existing tail, or None for creation.
Sourcepub fn records(&self) -> &[RecordEnvelope]
pub fn records(&self) -> &[RecordEnvelope]
Returns ordered canonical records.
Sourcepub const fn expected_journal_revision(&self) -> Option<u64>
pub const fn expected_journal_revision(&self) -> Option<u64>
Returns expected policy journal revision, when side facts are appended.
Sourcepub fn approval_artifacts(&self) -> &[ApprovalArtifactEntry]
pub fn approval_artifacts(&self) -> &[ApprovalArtifactEntry]
Returns typed approval side-journal entries.
Sourcepub fn grant_entries(&self) -> &[GrantJournalEntry]
pub fn grant_entries(&self) -> &[GrantJournalEntry]
Returns typed grant side-journal entries.
Trait Implementations§
Source§impl Clone for AppendTransaction
impl Clone for AppendTransaction
Source§fn clone(&self) -> AppendTransaction
fn clone(&self) -> AppendTransaction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AppendTransaction
impl RefUnwindSafe for AppendTransaction
impl Send for AppendTransaction
impl Sync for AppendTransaction
impl Unpin for AppendTransaction
impl UnsafeUnpin for AppendTransaction
impl UnwindSafe for AppendTransaction
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