pub struct LockManager { /* private fields */ }Expand description
Lock manager for managing resource locks.
Implementations§
Source§impl LockManager
impl LockManager
Sourcepub fn acquire(
&mut self,
resource: &str,
tx_id: u64,
lock_type: LockType,
) -> Result<()>
pub fn acquire( &mut self, resource: &str, tx_id: u64, lock_type: LockType, ) -> Result<()>
Acquires a lock on a resource.
Sourcepub fn release_all(&mut self, tx_id: u64)
pub fn release_all(&mut self, tx_id: u64)
Releases all locks held by a transaction.
Sourcepub fn holds_lock(&self, resource: &str, tx_id: u64) -> bool
pub fn holds_lock(&self, resource: &str, tx_id: u64) -> bool
Checks if a transaction holds a lock on a resource.
Sourcepub fn holds_exclusive(&self, resource: &str, tx_id: u64) -> bool
pub fn holds_exclusive(&self, resource: &str, tx_id: u64) -> bool
Checks if a transaction holds an exclusive lock on a resource.
Sourcepub fn get_locked_resources(&self, tx_id: u64) -> Vec<&str>
pub fn get_locked_resources(&self, tx_id: u64) -> Vec<&str>
Returns all resources locked by a transaction.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LockManager
impl RefUnwindSafe for LockManager
impl Send for LockManager
impl Sync for LockManager
impl Unpin for LockManager
impl UnwindSafe for LockManager
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