pub struct SemaphorePool { /* private fields */ }Expand description
Pool of named semaphores.
Implementations§
Source§impl SemaphorePool
impl SemaphorePool
pub fn new() -> Self
pub fn add(&mut self, name: &str, capacity: u32)
pub fn remove(&mut self, name: &str) -> bool
pub fn acquire(&mut self, name: &str, count: u32) -> bool
pub fn release(&mut self, name: &str, count: u32)
pub fn available(&self, name: &str) -> u32
pub fn capacity(&self, name: &str) -> u32
pub fn count(&self) -> usize
pub fn total_acquired(&self) -> u64
pub fn total_released(&self) -> u64
pub fn names(&self) -> Vec<&str>
pub fn is_full(&self, name: &str) -> bool
pub fn clear(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SemaphorePool
impl RefUnwindSafe for SemaphorePool
impl Send for SemaphorePool
impl Sync for SemaphorePool
impl Unpin for SemaphorePool
impl UnsafeUnpin for SemaphorePool
impl UnwindSafe for SemaphorePool
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