diff options
| author | Botahamec <botahamec@outlook.com> | 2024-09-25 21:36:13 -0400 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2024-09-25 21:36:13 -0400 |
| commit | 4fd5136e0c0ec9cc92bb2b5735c0b3b68acdd755 (patch) | |
| tree | 017bc3fd0e15ebb609383804b01651ee78bc4a3b /src/mutex.rs | |
| parent | 7443474f1f00d2a9306079641dbb3c18df5e6445 (diff) | |
Update docs for ref guards
Diffstat (limited to 'src/mutex.rs')
| -rw-r--r-- | src/mutex.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mutex.rs b/src/mutex.rs index b30c2b1..433ab47 100644 --- a/src/mutex.rs +++ b/src/mutex.rs @@ -36,14 +36,18 @@ pub struct Mutex<T: ?Sized, R> { data: UnsafeCell<T>, } -/// A reference to a mutex that unlocks it when dropped +/// A reference to a mutex that unlocks it when dropped. +/// +/// This is similar to [`MutexGuard`], except it does not hold a [`Keyable`]. pub struct MutexRef<'a, T: ?Sized + 'a, R: RawMutex>( &'a Mutex<T, R>, PhantomData<(&'a mut T, R::GuardMarker)>, ); -/// An RAII implementation of a “scoped lock” of a mutex. When this structure -/// is dropped (falls out of scope), the lock will be unlocked. +/// An RAII implementation of a “scoped lock” of a mutex. +/// +/// When this structure is dropped (falls out of scope), the lock will be +/// unlocked. /// /// This is created by calling the [`lock`] and [`try_lock`] methods on [`Mutex`] /// |
