pub struct ReadLock;
Expand description
A marker for locks that only allow reading.
Trait Implementations
sourceimpl<T: ?Sized> Lock<ReadLock> for RwSemaphore<T>
impl<T: ?Sized> Lock<ReadLock> for RwSemaphore<T>
type Inner = T
type Inner = T
The type of the data protected by the lock.
type GuardContext = EmptyGuardContext
type GuardContext = EmptyGuardContext
The type of context, if any, that needs to be stored in the guard.
sourcefn lock_noguard(&self) -> EmptyGuardContext
fn lock_noguard(&self) -> EmptyGuardContext
Acquires the lock, making the caller its owner.
sourceunsafe fn unlock(&self, _: &mut EmptyGuardContext)
unsafe fn unlock(&self, _: &mut EmptyGuardContext)
Releases the lock, giving up ownership of the lock. Read more
sourcefn locked_data(&self) -> &UnsafeCell<T>
fn locked_data(&self) -> &UnsafeCell<T>
Returns the data protected by the lock.
sourcefn relock(&self, ctx: &mut Self::GuardContext)
fn relock(&self, ctx: &mut Self::GuardContext)
Reacquires the lock, making the caller its owner. Read more
sourceimpl<L: Lock + ?Sized> Lock<ReadLock> for SeqLock<L>
impl<L: Lock + ?Sized> Lock<ReadLock> for SeqLock<L>
type GuardContext = <L as Lock<WriteLock>>::GuardContext
type GuardContext = <L as Lock<WriteLock>>::GuardContext
The type of context, if any, that needs to be stored in the guard.
sourcefn lock_noguard(&self) -> L::GuardContext
fn lock_noguard(&self) -> L::GuardContext
Acquires the lock, making the caller its owner.
sourcefn relock(&self, ctx: &mut L::GuardContext)
fn relock(&self, ctx: &mut L::GuardContext)
Reacquires the lock, making the caller its owner. Read more
sourceunsafe fn unlock(&self, ctx: &mut L::GuardContext)
unsafe fn unlock(&self, ctx: &mut L::GuardContext)
Releases the lock, giving up ownership of the lock. Read more
sourcefn locked_data(&self) -> &UnsafeCell<L::Inner>
fn locked_data(&self) -> &UnsafeCell<L::Inner>
Returns the data protected by the lock.
Auto Trait Implementations
impl RefUnwindSafe for ReadLock
impl Send for ReadLock
impl Sync for ReadLock
impl Unpin for ReadLock
impl UnwindSafe for ReadLock
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more