pub struct SharedReadLock<T>(/* private fields */);Available on crate feature
lite only.Expand description
A read-only reference to a resource possibly shared with up to one
Shared and many other SharedReadLocks.
Implementations§
Sourcepub async fn lock(&self) -> SharedReadGuard<'_, T>
pub async fn lock(&self) -> SharedReadGuard<'_, T>
Lock this SharedReadLock, causing the current task to
yield until the lock has been acquired.
Sourcepub fn try_lock(&self) -> TryLockResult<SharedReadGuard<'_, T>>
pub fn try_lock(&self) -> TryLockResult<SharedReadGuard<'_, T>>
Try to lock this SharedReadLock.
If the value is currently locked for writing through the corresponding
Shared instance, returns TryLockError.
Trait Implementations§
Source§fn clone(&self) -> SharedReadLock<T>
fn clone(&self) -> SharedReadLock<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
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