pub struct TransactionManager { /* private fields */ }Expand description
Manages atomic multi-file operations with all-or-nothing semantics
Implementations§
Source§impl TransactionManager
impl TransactionManager
Sourcepub fn new(backup_manager: BackupManager) -> Self
pub fn new(backup_manager: BackupManager) -> Self
Creates a new TransactionManager instance
§Arguments
backup_manager- BackupManager for handling backups during rollback
Sourcepub async fn begin_transaction(&self) -> Result<Uuid, FileError>
pub async fn begin_transaction(&self) -> Result<Uuid, FileError>
Sourcepub async fn add_operation(
&self,
tx_id: Uuid,
op: FileOperation,
) -> Result<(), FileError>
pub async fn add_operation( &self, tx_id: Uuid, op: FileOperation, ) -> Result<(), FileError>
Sourcepub async fn get_status(
&self,
tx_id: Uuid,
) -> Result<TransactionStatus, FileError>
pub async fn get_status( &self, tx_id: Uuid, ) -> Result<TransactionStatus, FileError>
Sourcepub async fn get_transaction(
&self,
tx_id: Uuid,
) -> Result<FileTransaction, FileError>
pub async fn get_transaction( &self, tx_id: Uuid, ) -> Result<FileTransaction, FileError>
Trait Implementations§
Source§impl Clone for TransactionManager
impl Clone for TransactionManager
Source§fn clone(&self) -> TransactionManager
fn clone(&self) -> TransactionManager
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 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§
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