pub struct RedisDistributedReaderWriterLock { /* private fields */ }Expand description
A Redis-based distributed reader-writer lock.
Supports single-server and multi-server (RedLock) configurations.
Implementations§
Trait Implementations§
Source§impl DistributedReaderWriterLock for RedisDistributedReaderWriterLock
impl DistributedReaderWriterLock for RedisDistributedReaderWriterLock
Source§type ReadHandle = RedisReadLockHandle
type ReadHandle = RedisReadLockHandle
Handle type for read (shared) locks.
Source§type WriteHandle = RedisWriteLockHandle
type WriteHandle = RedisWriteLockHandle
Handle type for write (exclusive) locks.
Source§async fn acquire_read(
&self,
timeout: Option<Duration>,
) -> LockResult<Self::ReadHandle>
async fn acquire_read( &self, timeout: Option<Duration>, ) -> LockResult<Self::ReadHandle>
Acquires a read (shared) lock. Read more
Source§async fn try_acquire_read(&self) -> LockResult<Option<Self::ReadHandle>>
async fn try_acquire_read(&self) -> LockResult<Option<Self::ReadHandle>>
Attempts to acquire a read lock without waiting.
Source§async fn acquire_write(
&self,
timeout: Option<Duration>,
) -> LockResult<Self::WriteHandle>
async fn acquire_write( &self, timeout: Option<Duration>, ) -> LockResult<Self::WriteHandle>
Acquires a write (exclusive) lock. Read more
Source§async fn try_acquire_write(&self) -> LockResult<Option<Self::WriteHandle>>
async fn try_acquire_write(&self) -> LockResult<Option<Self::WriteHandle>>
Attempts to acquire a write lock without waiting.
Auto Trait Implementations§
impl Freeze for RedisDistributedReaderWriterLock
impl !RefUnwindSafe for RedisDistributedReaderWriterLock
impl Send for RedisDistributedReaderWriterLock
impl Sync for RedisDistributedReaderWriterLock
impl Unpin for RedisDistributedReaderWriterLock
impl !UnwindSafe for RedisDistributedReaderWriterLock
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more