pub struct Semaphore { /* fields omitted */ }Creates a new semaphore with the initial number of permits
Panics if permits is zero.
Returns the current number of available permits
Close the semaphore. This prevents the semaphore from issuing new
permits and notifies all pending waiters.
Add n new permits to the semaphore.
Formats the value using the given formatter. Read more
🔬 This is a nightly-only experimental API. (try_from)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from)
🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static