pub struct RLock { /* private fields */ }Expand description
=== RLock (Reentrant lock) ===
Implementations§
Source§impl RLock
impl RLock
pub fn new( connection_manager: Arc<SyncRedisConnectionManager>, name: String, lease_time: Duration, ) -> Self
Sourcepub fn lock(&self) -> RedissonResult<()>
pub fn lock(&self) -> RedissonResult<()>
Lock acquisition (blocking)
Sourcepub fn lock_with_lease_time(&self, lease_time: Duration) -> RedissonResult<()>
pub fn lock_with_lease_time(&self, lease_time: Duration) -> RedissonResult<()>
Lock with lease duration
Sourcepub fn try_lock(&self) -> RedissonResult<bool>
pub fn try_lock(&self) -> RedissonResult<bool>
Attempt to acquire lock (non-blocking)
Sourcepub fn try_lock_with_timeout(&self, wait_time: Duration) -> RedissonResult<bool>
pub fn try_lock_with_timeout(&self, wait_time: Duration) -> RedissonResult<bool>
An attempt to acquire a lock with a timeout
Sourcepub fn unlock(&self) -> RedissonResult<bool>
pub fn unlock(&self) -> RedissonResult<bool>
Release a lock
Sourcepub fn force_unlock(&self) -> RedissonResult<bool>
pub fn force_unlock(&self) -> RedissonResult<bool>
Force unlock (ignore reentry count)
Sourcepub fn is_locked(&self) -> RedissonResult<bool>
pub fn is_locked(&self) -> RedissonResult<bool>
Check if the lock is held
Sourcepub fn is_held_by_current_thread(&self) -> bool
pub fn is_held_by_current_thread(&self) -> bool
Checks whether the current thread holds the lock
Sourcepub fn remaining_time(&self) -> RedissonResult<Duration>
pub fn remaining_time(&self) -> RedissonResult<Duration>
Time remaining to acquire the lock
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RLock
impl !RefUnwindSafe for RLock
impl Send for RLock
impl Sync for RLock
impl Unpin for RLock
impl !UnwindSafe for RLock
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