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§

source

type System: KernelSemaphore

The system type this object pertains to.

Required Methods§

source

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.

source

fn id(&self) -> <Self::System as KernelSemaphore>::RawSemaphoreId

Get the raw RawSemaphoreId value representing this object.

source

fn borrow(&self) -> SemaphoreRef<'_, Self::System>

Implementors§

source§

impl<System> SemaphoreHandle for Semaphore<System>where System: NotSupportedYet,

§

type System = System

source§

impl<System> SemaphoreHandle for SemaphoreRef<'_, System>where System: KernelSemaphore,

§

type System = System