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: KernelSemaphore> SemaphoreHandle for SemaphoreRef<'_, System>

§

type System = System

source§

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

§

type System = System