pub trait Semaphore: Default {
type Instant: Instant;
// Required methods
fn give(&self);
fn try_take(&self) -> bool;
fn take(&self, timeout: Option<Duration>) -> bool;
// Provided method
fn take_iter(&self, timeout: Option<Duration>) -> TakeIter<'_, Self> ⓘ { ... }
}
Expand description
Binary semaphore.
Required Associated Types§
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.