Skip to main content

RawSpinRwLock

Struct RawSpinRwLock 

Source
pub struct RawSpinRwLock<T>(/* private fields */)
where
    T: ?Sized;
Expand description

A non-sleeping read-write lock with acquisition-site context policy.

Implementations§

Source§

impl<T> RawSpinRwLock<T>

Source

pub const fn new(data: T) -> RawSpinRwLock<T>

Creates an unlocked spin read-write lock.

Source

pub fn into_inner(self) -> T

Consumes the lock and returns the protected value.

Source§

impl<T> RawSpinRwLock<T>
where T: ?Sized,

Source

pub fn read(&self) -> BaseSpinRwLockReadGuard<'_, PreemptState, T>

Acquires a read guard after disabling preemption.

Source

pub fn try_read(&self) -> Option<BaseSpinRwLockReadGuard<'_, PreemptState, T>>

Attempts a read acquisition after disabling preemption.

Source

pub fn write(&self) -> BaseSpinRwLockWriteGuard<'_, PreemptState, T>

Acquires a write guard after disabling preemption.

Source

pub fn try_write(&self) -> Option<BaseSpinRwLockWriteGuard<'_, PreemptState, T>>

Attempts a write acquisition after disabling preemption.

Source

pub fn read_irqsave( &self, ) -> BaseSpinRwLockReadGuard<'_, PreemptIrqSaveState, T>

Acquires an IRQ-save read guard.

Source

pub fn try_read_irqsave( &self, ) -> Option<BaseSpinRwLockReadGuard<'_, PreemptIrqSaveState, T>>

Attempts an IRQ-save read acquisition.

Source

pub fn write_irqsave( &self, ) -> BaseSpinRwLockWriteGuard<'_, PreemptIrqSaveState, T>

Acquires an IRQ-save write guard.

Source

pub fn try_write_irqsave( &self, ) -> Option<BaseSpinRwLockWriteGuard<'_, PreemptIrqSaveState, T>>

Attempts an IRQ-save write acquisition.

Source

pub unsafe fn read_raw(&self) -> BaseSpinRwLockReadGuard<'_, RawState, T>

Acquires a raw read guard without changing execution context.

§Safety

The caller must prevent re-entry and uphold the read-side exclusion contract, including on single-core builds.

Source

pub unsafe fn try_read_raw( &self, ) -> Option<BaseSpinRwLockReadGuard<'_, RawState, T>>

Attempts a raw read acquisition.

§Safety

The caller must uphold the contract of Self::read_raw.

Source

pub unsafe fn write_raw(&self) -> BaseSpinRwLockWriteGuard<'_, RawState, T>

Acquires a raw write guard without changing execution context.

§Safety

The caller must prevent re-entry and concurrent readers or writers, including on single-core builds.

Source

pub unsafe fn try_write_raw( &self, ) -> Option<BaseSpinRwLockWriteGuard<'_, RawState, T>>

Attempts a raw write acquisition.

§Safety

The caller must uphold the contract of Self::write_raw.

Source

pub fn get_mut(&mut self) -> &mut T

Returns mutable access without locking.

Trait Implementations§

Source§

impl<T> Debug for RawSpinRwLock<T>
where T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Default for RawSpinRwLock<T>
where T: Default,

Source§

fn default() -> RawSpinRwLock<T>

Returns the “default value” for a type. Read more
Source§

impl<T> From<T> for RawSpinRwLock<T>

Source§

fn from(value: T) -> RawSpinRwLock<T>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T> !Freeze for RawSpinRwLock<T>

§

impl<T> !RefUnwindSafe for RawSpinRwLock<T>

§

impl<T> Send for RawSpinRwLock<T>
where BaseSpinRwLock<RawState, T>: Send, T: ?Sized,

§

impl<T> Sync for RawSpinRwLock<T>
where BaseSpinRwLock<RawState, T>: Sync, T: ?Sized,

§

impl<T> Unpin for RawSpinRwLock<T>
where BaseSpinRwLock<RawState, T>: Unpin, T: ?Sized,

§

impl<T> UnsafeUnpin for RawSpinRwLock<T>
where BaseSpinRwLock<RawState, T>: UnsafeUnpin, T: ?Sized,

§

impl<T> UnwindSafe for RawSpinRwLock<T>
where BaseSpinRwLock<RawState, T>: UnwindSafe, T: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.