pub struct TransactionManager { /* private fields */ }Expand description
Manages transaction state independently of graph mutations
Implementations§
Source§impl TransactionManager
impl TransactionManager
Sourcepub fn with_max_size(max_size: usize) -> Self
pub fn with_max_size(max_size: usize) -> Self
Create a transaction manager with custom size limit
Sourcepub fn begin(
&mut self,
change_log_size: usize,
) -> Result<TransactionId, TransactionError>
pub fn begin( &mut self, change_log_size: usize, ) -> Result<TransactionId, TransactionError>
Sourcepub fn commit(&mut self) -> Result<TransactionId, TransactionError>
pub fn commit(&mut self) -> Result<TransactionId, TransactionError>
Sourcepub fn rollback_info(
&mut self,
) -> Result<(TransactionId, usize), TransactionError>
pub fn rollback_info( &mut self, ) -> Result<(TransactionId, usize), TransactionError>
Sourcepub fn add_savepoint(
&mut self,
name: String,
change_log_size: usize,
) -> Result<(), TransactionError>
pub fn add_savepoint( &mut self, name: String, change_log_size: usize, ) -> Result<(), TransactionError>
Sourcepub fn get_savepoint(&self, name: &str) -> Result<usize, TransactionError>
pub fn get_savepoint(&self, name: &str) -> Result<usize, TransactionError>
Sourcepub fn truncate_savepoints(&mut self, index: usize)
pub fn truncate_savepoints(&mut self, index: usize)
Remove savepoints after a given index (for partial rollback)
§Arguments
index- Remove all savepoints with index >= this value
Sourcepub fn active_id(&self) -> Option<TransactionId>
pub fn active_id(&self) -> Option<TransactionId>
Get the ID of the active transaction if any
Sourcepub fn check_size(&self, change_log_size: usize) -> Result<(), TransactionError>
pub fn check_size(&self, change_log_size: usize) -> Result<(), TransactionError>
Sourcepub fn set_max_size(&mut self, max_size: usize)
pub fn set_max_size(&mut self, max_size: usize)
Set the maximum transaction size limit
Sourcepub fn start_index(&self) -> Option<usize>
pub fn start_index(&self) -> Option<usize>
Get the start index of the active transaction
Sourcepub fn savepoints(&self) -> Vec<(String, usize)>
pub fn savepoints(&self) -> Vec<(String, usize)>
Get all savepoints in the current transaction
Trait Implementations§
Source§impl Debug for TransactionManager
impl Debug for TransactionManager
Auto Trait Implementations§
impl Freeze for TransactionManager
impl RefUnwindSafe for TransactionManager
impl Send for TransactionManager
impl Sync for TransactionManager
impl Unpin for TransactionManager
impl UnwindSafe for TransactionManager
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> 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