pub trait RPQueue<'a, T> {
// Required methods
fn capacity(&self) -> usize;
fn available(&self) -> usize;
fn take(&self) -> Option<&'a mut T>;
fn take_wait(&self, timeout: Duration) -> Option<&'a mut T>;
fn offer(&self, item: &'a T) -> usize;
}Expand description
RPQueue trait for pool queues
Required Methods§
Sourcefn capacity(&self) -> usize
fn capacity(&self) -> usize
Returns the size of the queue in total number objects originally allocated
Sourcefn take(&self) -> Option<&'a mut T>
fn take(&self) -> Option<&'a mut T>
Returns an object from the queue or None if the pool is empty available.
This method is preferred over take_wait when empty or near empty pools are common.