Trait Semaphore

Source
pub unsafe trait Semaphore: TrySemaphore {
    // Required method
    fn wait(&self);
}
Expand description

A generic semaphore.

§Safety

This trait is marked as unsafe to allow for safe code to rely on the standard semaphore contract. Default implementations should initialize the count at 0.

Required Methods§

Source

fn wait(&self)

Decrements the count if able or blocks until able.

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.

Implementors§