pub struct RocketMQTokioMutex<T: ?Sized> { /* private fields */ }
Implementations§
Source§impl<T: ?Sized> RocketMQTokioMutex<T>
impl<T: ?Sized> RocketMQTokioMutex<T>
Sourcepub async fn lock(&self) -> MutexGuard<'_, T>
pub async fn lock(&self) -> MutexGuard<'_, T>
Acquires the lock asynchronously, blocking the current task until it is able to do so.
§Returns
A MutexGuard
that releases the lock when dropped.
Sourcepub async fn try_lock(&self) -> Option<MutexGuard<'_, T>>
pub async fn try_lock(&self) -> Option<MutexGuard<'_, T>>
Attempts to acquire the lock asynchronously without blocking.
§Returns
An Option
containing a MutexGuard
if the lock was successfully acquired, or None
if
the lock is already held.
Sourcepub async fn try_lock_timeout(
&self,
timeout: Duration,
) -> Option<MutexGuard<'_, T>>
pub async fn try_lock_timeout( &self, timeout: Duration, ) -> Option<MutexGuard<'_, T>>
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for RocketMQTokioMutex<T>
impl<T> !RefUnwindSafe for RocketMQTokioMutex<T>
impl<T> Send for RocketMQTokioMutex<T>
impl<T> Sync for RocketMQTokioMutex<T>
impl<T> Unpin for RocketMQTokioMutex<T>
impl<T> !UnwindSafe for RocketMQTokioMutex<T>
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