Skip to main content

SemaphoreProvider

Trait SemaphoreProvider 

Source
pub trait SemaphoreProvider: Send + Sync {
    type Semaphore: DistributedSemaphore;

    // Required method
    fn create_semaphore(&self, name: &str, max_count: u32) -> Self::Semaphore;
}
Expand description

Factory for creating semaphores by name.

Required Associated Types§

Source

type Semaphore: DistributedSemaphore

The semaphore type created by this provider.

Required Methods§

Source

fn create_semaphore(&self, name: &str, max_count: u32) -> Self::Semaphore

Creates a semaphore with the given name and max count.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§