pub struct KMutex<Class: LockClass, M: RawLock = RawMutex> { /* private fields */ }Expand description
A safe, Zircon-compatible mutual exclusion lock supporting compile-time order validation.
KMutex wraps a platform-specific RawLock abstraction. It is pinned in memory to support FFI
loop-detector active list registrations safely under the lock class Class.
Implementations§
Source§impl<Class: LockClass, M: RawLock> KMutex<Class, M>
impl<Class: LockClass, M: RawLock> KMutex<Class, M>
Sourcepub fn init() -> impl PinInit<Self, Infallible>
pub fn init() -> impl PinInit<Self, Infallible>
Safe dynamic initialization of the validation lock inside pin context.
Sourcepub fn lock(&self) -> impl PinInit<KMutexGuard<'_, Class, M>, Infallible>
pub fn lock(&self) -> impl PinInit<KMutexGuard<'_, Class, M>, Infallible>
Acquires the lock and registers the active loop node.
Trait Implementations§
Auto Trait Implementations§
impl<Class, M> Freeze for KMutex<Class, M>where
M: Freeze,
impl<Class, M> RefUnwindSafe for KMutex<Class, M>where
M: RefUnwindSafe,
Class: RefUnwindSafe,
impl<Class, M> Send for KMutex<Class, M>
impl<Class, M> Sync for KMutex<Class, M>
impl<Class, M> UnsafeUnpin for KMutex<Class, M>where
M: UnsafeUnpin,
impl<Class, M> UnwindSafe for KMutex<Class, M>where
M: UnwindSafe,
Class: UnwindSafe,
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
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
Initializes
slot. Read more