pub struct TransactionJournalEntry {
pub tx_id: Uuid,
pub session_id: Uuid,
pub node_id: NodeId,
pub started_at: DateTime<Utc>,
pub start_lsn: u64,
pub entries: Vec<JournalEntry>,
pub current_sequence: u64,
pub active: bool,
pub has_mutations: bool,
pub savepoints: Vec<Savepoint>,
}Expand description
Transaction journal for a single transaction
Fields§
§tx_id: UuidTransaction ID
session_id: UuidSession ID
node_id: NodeIdNode where transaction started
started_at: DateTime<Utc>Transaction start time
start_lsn: u64Start LSN (for WAL synchronization)
entries: Vec<JournalEntry>Journal entries
current_sequence: u64Current sequence
active: boolIs transaction active
has_mutations: boolHas mutations
savepoints: Vec<Savepoint>Savepoints
Implementations§
Source§impl TransactionJournalEntry
impl TransactionJournalEntry
Sourcepub fn new(
tx_id: Uuid,
session_id: Uuid,
node_id: NodeId,
start_lsn: u64,
) -> Self
pub fn new( tx_id: Uuid, session_id: Uuid, node_id: NodeId, start_lsn: u64, ) -> Self
Create a new transaction journal entry
Sourcepub fn add_entry(&mut self, entry: JournalEntry)
pub fn add_entry(&mut self, entry: JournalEntry)
Add an entry to the journal
Sourcepub fn create_savepoint(&mut self, name: String)
pub fn create_savepoint(&mut self, name: String)
Create a savepoint
Sourcepub fn rollback_to_savepoint(&mut self, name: &str) -> Option<u64>
pub fn rollback_to_savepoint(&mut self, name: &str) -> Option<u64>
Rollback to savepoint
Sourcepub fn entries_for_replay(&self) -> Vec<&JournalEntry>
pub fn entries_for_replay(&self) -> Vec<&JournalEntry>
Get entries for replay
Sourcepub fn mutation_entries(&self) -> Vec<&JournalEntry>
pub fn mutation_entries(&self) -> Vec<&JournalEntry>
Get only mutation entries
Sourcepub fn total_size(&self) -> usize
pub fn total_size(&self) -> usize
Calculate total size of journal
Trait Implementations§
Source§impl Clone for TransactionJournalEntry
impl Clone for TransactionJournalEntry
Source§fn clone(&self) -> TransactionJournalEntry
fn clone(&self) -> TransactionJournalEntry
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 moreAuto Trait Implementations§
impl Freeze for TransactionJournalEntry
impl RefUnwindSafe for TransactionJournalEntry
impl Send for TransactionJournalEntry
impl Sync for TransactionJournalEntry
impl Unpin for TransactionJournalEntry
impl UnsafeUnpin for TransactionJournalEntry
impl UnwindSafe for TransactionJournalEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more