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