Skip to main content

RBucket

Struct RBucket 

Source
pub struct RBucket<V> { /* private fields */ }

Implementations§

Source§

impl<V> RBucket<V>
where V: Serialize + DeserializeOwned + Send + Sync + 'static,

Source

pub fn new( connection_manager: Arc<SyncRedisConnectionManager>, name: String, ) -> Self

Source

pub fn with_ttl(self, ttl: Duration) -> Self

Source

pub fn set(&self, value: &V) -> RedissonResult<()>

Source

pub fn set_with_ttl(&self, value: &V, ttl: Duration) -> RedissonResult<()>

Source

pub fn get(&self) -> RedissonResult<Option<V>>

Source

pub fn get_and_set(&self, value: &V) -> RedissonResult<Option<V>>

Source

pub fn compare_and_set( &self, expect: Option<&V>, update: &V, ) -> RedissonResult<bool>

Source

pub fn increment(&self, delta: i64) -> RedissonResult<i64>
where V: From<i64> + Into<i64>,

Source

pub fn decrement(&self, delta: i64) -> RedissonResult<i64>
where V: From<i64> + Into<i64>,

Trait Implementations§

Source§

impl<V> RLockable for RBucket<V>
where V: Serialize + DeserializeOwned + Send + Sync + 'static,

Source§

fn get_lock(&self) -> RLock

Acquire a distributed lock on an object
Source§

fn get_fair_lock(&self) -> RFairLock

Acquires a fair lock on an object
Source§

fn lock(&self) -> RedissonResult<()>

Locking objects
Source§

fn try_lock(&self) -> RedissonResult<bool>

Attempt to lock the object
Source§

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<()>

Lock the object and set the lease time
Source§

fn unlock(&self) -> RedissonResult<bool>

Unlocking the object
Source§

fn force_unlock(&self) -> RedissonResult<bool>

Force unlocking an object
Source§

fn is_locked(&self) -> RedissonResult<bool>

Check if it is locked
Source§

fn is_held_by_current_thread(&self) -> bool

Checks whether the current thread holds the lock
Source§

impl<V> RObject for RBucket<V>
where V: Serialize + DeserializeOwned + Send + Sync + 'static,

Source§

fn get_name(&self) -> &str

Getting the object name
Source§

fn delete(&self) -> RedissonResult<bool>

Deleting objects
Source§

fn rename(&self, new_name: &str) -> RedissonResult<()>

Renaming Objects
Source§

fn is_exists(&self) -> RedissonResult<bool>

Checks if the object exists
Source§

fn move_to_db(&self, db_index: i32) -> RedissonResult<bool>

Move objects to other databases
Source§

fn get_expire_time(&self) -> RedissonResult<Option<Duration>>

Getting the expiration time
Source§

fn expire(&self, duration: Duration) -> RedissonResult<bool>

Set an expiration time
Source§

fn expire_at(&self, timestamp: i64) -> RedissonResult<bool>

Set an expiration point
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more