pub struct RBucket<V> { /* private fields */ }Implementations§
Source§impl<V> RBucket<V>
impl<V> RBucket<V>
pub fn new( connection_manager: Arc<SyncRedisConnectionManager>, name: String, ) -> Self
pub fn with_ttl(self, ttl: Duration) -> Self
pub fn set(&self, value: &V) -> RedissonResult<()>
pub fn set_with_ttl(&self, value: &V, ttl: Duration) -> RedissonResult<()>
pub fn get(&self) -> RedissonResult<Option<V>>
pub fn get_and_set(&self, value: &V) -> RedissonResult<Option<V>>
pub fn compare_and_set( &self, expect: Option<&V>, update: &V, ) -> RedissonResult<bool>
pub fn increment(&self, delta: i64) -> RedissonResult<i64>
pub fn decrement(&self, delta: i64) -> RedissonResult<i64>
Trait Implementations§
Source§impl<V> RLockable for RBucket<V>
impl<V> RLockable for RBucket<V>
Source§fn get_fair_lock(&self) -> RFairLock
fn get_fair_lock(&self) -> RFairLock
Acquires a fair lock on an object
Source§fn lock(&self) -> RedissonResult<()>
fn lock(&self) -> RedissonResult<()>
Locking objects
Source§fn try_lock(&self) -> RedissonResult<bool>
fn try_lock(&self) -> RedissonResult<bool>
Attempt to lock the object
Source§fn try_lock_timeout(&self, wait_time: Duration) -> RedissonResult<bool>
fn try_lock_timeout(&self, wait_time: Duration) -> RedissonResult<bool>
Attempt to lock the object with a timeout
Source§fn lock_lease(&self, lease_time: Duration) -> RedissonResult<()>
fn lock_lease(&self, lease_time: Duration) -> RedissonResult<()>
Lock the object and set the lease time
Source§fn unlock(&self) -> RedissonResult<bool>
fn unlock(&self) -> RedissonResult<bool>
Unlocking the object
Source§fn force_unlock(&self) -> RedissonResult<bool>
fn force_unlock(&self) -> RedissonResult<bool>
Force unlocking an object
Source§fn is_locked(&self) -> RedissonResult<bool>
fn is_locked(&self) -> RedissonResult<bool>
Check if it is locked
Source§fn is_held_by_current_thread(&self) -> bool
fn is_held_by_current_thread(&self) -> bool
Checks whether the current thread holds the lock
Source§impl<V> RObject for RBucket<V>
impl<V> RObject for RBucket<V>
Source§fn delete(&self) -> RedissonResult<bool>
fn delete(&self) -> RedissonResult<bool>
Deleting objects
Source§fn is_exists(&self) -> RedissonResult<bool>
fn is_exists(&self) -> RedissonResult<bool>
Checks if the object exists
Source§fn move_to_db(&self, db_index: i32) -> RedissonResult<bool>
fn move_to_db(&self, db_index: i32) -> RedissonResult<bool>
Move objects to other databases
Source§fn get_expire_time(&self) -> RedissonResult<Option<Duration>>
fn get_expire_time(&self) -> RedissonResult<Option<Duration>>
Getting the expiration time
Source§fn clear_expire(&self) -> RedissonResult<bool>
fn clear_expire(&self) -> RedissonResult<bool>
Clear the expiration time
Auto Trait Implementations§
impl<V> Freeze for RBucket<V>
impl<V> !RefUnwindSafe for RBucket<V>
impl<V> Send for RBucket<V>where
V: Send,
impl<V> Sync for RBucket<V>where
V: Sync,
impl<V> Unpin for RBucket<V>where
V: Unpin,
impl<V> !UnwindSafe for RBucket<V>
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