pub struct SemaphoreKey {}
Expand description
The SemaphoreKey struct holds an implementation to be used to for the Semaphore by key functionality.
Implementations§
Source§impl SemaphoreKey
impl SemaphoreKey
Sourcepub async fn get_or_create_semaphore(
key: &String,
allowed_concurrent_threads: usize,
) -> Arc<Semaphore>
pub async fn get_or_create_semaphore( key: &String, allowed_concurrent_threads: usize, ) -> Arc<Semaphore>
Gets or creates a semaphore wrapped in an Arc by the provided key
§Arguments
-
key
- The key to get an existing or create a new semaphore by -
allowed_concurrent_threads
- Used when creating a new semaphore (if an existing one is not found by key), to specify how many concurrent threads are allowed access.
Auto Trait Implementations§
impl Freeze for SemaphoreKey
impl RefUnwindSafe for SemaphoreKey
impl Send for SemaphoreKey
impl Sync for SemaphoreKey
impl Unpin for SemaphoreKey
impl UnwindSafe for SemaphoreKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more