Trait r3_core::kernel::mutex::MutexHandle
source · pub unsafe trait MutexHandle {
type System: KernelMutex;
// Required methods
unsafe fn from_id(id: <Self::System as KernelMutex>::RawMutexId) -> Self;
fn id(&self) -> <Self::System as KernelMutex>::RawMutexId;
fn borrow(&self) -> MutexRef<'_, Self::System>;
}
Expand description
The trait for safe wrappers of System::
RawMutexId
, i.e.,
Mutex
and MutexRef
.
Required Associated Types§
sourcetype System: KernelMutex
type System: KernelMutex
The system type this object pertains to.
Required Methods§
sourceunsafe fn from_id(id: <Self::System as KernelMutex>::RawMutexId) -> Self
unsafe fn from_id(id: <Self::System as KernelMutex>::RawMutexId) -> Self
Construct a Mutex
from RawMutexId
.
Safety
This function is marked as unsafe
to prevent safe code from
compromising object safety.
sourcefn id(&self) -> <Self::System as KernelMutex>::RawMutexId
fn id(&self) -> <Self::System as KernelMutex>::RawMutexId
Get the raw RawMutexId
value representing this object.