pub struct SpinRwLock<T: ?Sized> { /* private fields */ }Expand description
A non-sleeping read-write lock.
Implementations§
Source§impl<T> SpinRwLock<T>
impl<T> SpinRwLock<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the lock and returns the protected value.
Source§impl<T: ?Sized> SpinRwLock<T>
impl<T: ?Sized> SpinRwLock<T>
Sourcepub fn read(&self) -> SpinRwLockReadGuard<'_, T>
pub fn read(&self) -> SpinRwLockReadGuard<'_, T>
Acquires a read guard after disabling preemption.
Sourcepub fn try_read(&self) -> Option<SpinRwLockReadGuard<'_, T>>
pub fn try_read(&self) -> Option<SpinRwLockReadGuard<'_, T>>
Attempts a read acquisition after disabling preemption.
Sourcepub fn write(&self) -> SpinRwLockWriteGuard<'_, T>
pub fn write(&self) -> SpinRwLockWriteGuard<'_, T>
Acquires a write guard after disabling preemption.
Sourcepub fn try_write(&self) -> Option<SpinRwLockWriteGuard<'_, T>>
pub fn try_write(&self) -> Option<SpinRwLockWriteGuard<'_, T>>
Attempts a write acquisition after disabling preemption.
Sourcepub fn read_irqsave(&self) -> SpinRwLockIrqSaveReadGuard<'_, T>
pub fn read_irqsave(&self) -> SpinRwLockIrqSaveReadGuard<'_, T>
Acquires an IRQ-save read guard.
Sourcepub fn try_read_irqsave(&self) -> Option<SpinRwLockIrqSaveReadGuard<'_, T>>
pub fn try_read_irqsave(&self) -> Option<SpinRwLockIrqSaveReadGuard<'_, T>>
Attempts an IRQ-save read acquisition.
Sourcepub fn write_irqsave(&self) -> SpinRwLockIrqSaveWriteGuard<'_, T>
pub fn write_irqsave(&self) -> SpinRwLockIrqSaveWriteGuard<'_, T>
Acquires an IRQ-save write guard.
Sourcepub fn try_write_irqsave(&self) -> Option<SpinRwLockIrqSaveWriteGuard<'_, T>>
pub fn try_write_irqsave(&self) -> Option<SpinRwLockIrqSaveWriteGuard<'_, T>>
Attempts an IRQ-save write acquisition.
Sourcepub unsafe fn read_raw(&self) -> RawSpinRwLockReadGuard<'_, T>
pub unsafe fn read_raw(&self) -> RawSpinRwLockReadGuard<'_, T>
Sourcepub unsafe fn try_read_raw(&self) -> Option<RawSpinRwLockReadGuard<'_, T>>
pub unsafe fn try_read_raw(&self) -> Option<RawSpinRwLockReadGuard<'_, T>>
Sourcepub unsafe fn write_raw(&self) -> RawSpinRwLockWriteGuard<'_, T>
pub unsafe fn write_raw(&self) -> RawSpinRwLockWriteGuard<'_, T>
Acquires a raw write guard.
§Safety
The caller must prevent re-entry and concurrent readers or writers.
Sourcepub unsafe fn try_write_raw(&self) -> Option<RawSpinRwLockWriteGuard<'_, T>>
pub unsafe fn try_write_raw(&self) -> Option<RawSpinRwLockWriteGuard<'_, T>>
Trait Implementations§
Source§impl<T: Debug> Debug for SpinRwLock<T>
impl<T: Debug> Debug for SpinRwLock<T>
Source§impl<T: Default> Default for SpinRwLock<T>
impl<T: Default> Default for SpinRwLock<T>
Source§impl<T> From<T> for SpinRwLock<T>
impl<T> From<T> for SpinRwLock<T>
impl<T: ?Sized + Send + Sync> Send for SpinRwLock<T>
impl<T: ?Sized + Send + Sync> Sync for SpinRwLock<T>
Auto Trait Implementations§
impl<T> !Freeze for SpinRwLock<T>
impl<T> !RefUnwindSafe for SpinRwLock<T>
impl<T> Unpin for SpinRwLock<T>
impl<T> UnsafeUnpin for SpinRwLock<T>where
T: UnsafeUnpin + ?Sized,
impl<T> UnwindSafe for SpinRwLock<T>where
T: UnwindSafe + ?Sized,
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