diff options
| author | Botahamec <botahamec@outlook.com> | 2024-05-22 20:59:09 -0400 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2024-05-22 20:59:09 -0400 |
| commit | 878f4fae4d3c6e64ab3824bf3fc012fbb5293a21 (patch) | |
| tree | f6550c400decbc1805c5957460177380d7c94718 /src/rwlock/read_guard.rs | |
| parent | 1ed88daa00d478472181f0987112a2b0f2266694 (diff) | |
Documentation
Diffstat (limited to 'src/rwlock/read_guard.rs')
| -rw-r--r-- | src/rwlock/read_guard.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rwlock/read_guard.rs b/src/rwlock/read_guard.rs index da3d101..e46078c 100644 --- a/src/rwlock/read_guard.rs +++ b/src/rwlock/read_guard.rs @@ -46,7 +46,9 @@ impl<'a, T: ?Sized + 'a, R: RawRwLock> Drop for RwLockReadRef<'a, T, R> { } impl<'a, T: ?Sized + 'a, R: RawRwLock> RwLockReadRef<'a, T, R> { - pub unsafe fn new(mutex: &'a RwLock<T, R>) -> Self { + /// Creates an immutable reference for the underlying data of an [`RwLock`] + /// without locking it or taking ownership of the key. + pub(crate) unsafe fn new(mutex: &'a RwLock<T, R>) -> Self { Self(mutex, PhantomData) } } |
