#[repr(transparent)]
pub struct Semaphore<System: NotSupportedYet>(_);
Expand description

Represents a single semaphore in a system.

This type is ABI-compatible with System::RawSemaphoreId.

See SemaphoreRef for the borrowed counterpart. See SemaphoreMethods for the operations provided by this handle type.

A semaphore maintains a set of permits that can be acquired (possibly blocking) or released by application code. The number of permits held by a semaphore is called the semaphore’s value and represented by SemaphoreValue.

Relation to Other Specifications: Present in almost every real-time operating system.

Trait Implementations

Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
The system type this object pertains to.
Construct a Semaphore from RawSemaphoreId. Read more
Get the raw RawSemaphoreId value representing this object.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Remove all permits held by the semaphore.
Get the number of permits currently held by the semaphore.
Release count permits, returning them to the semaphore.
Release a permit, returning it to the semaphore.
Acquire a permit, potentially blocking the calling thread until one is available. Read more
wait_one with timeout.
Non-blocking version of wait_one. Returns immediately with PollSemaphoreError::Timeout if the unblocking condition is not satisfied. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.