pub struct Bag<T, const ARRAY_LEN: usize = DEFAULT_ARRAY_LEN> { /* private fields */ }Expand description
Bag is a lock-free concurrent unordered instance container.
Bag is a linearizable concurrent instance container where ARRAY_LEN instances are stored
in a fixed-size array, and the rest are managed by its backup container; this makes a Bag
especially efficient if the expected number of instances does not exceed ARRAY_LEN.
The maximum value of ARRAY_LEN is limited to usize::MAX / 2 which is the default value, and
if a larger value is specified, Bag::new panics.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T, const ARRAY_LEN: usize> RefUnwindSafe for Bag<T, ARRAY_LEN>where T: RefUnwindSafe,
impl<T, const ARRAY_LEN: usize> Send for Bag<T, ARRAY_LEN>where T: Send,
impl<T, const ARRAY_LEN: usize> Sync for Bag<T, ARRAY_LEN>where T: Sync,
impl<T, const ARRAY_LEN: usize> Unpin for Bag<T, ARRAY_LEN>where T: Unpin,
impl<T, const ARRAY_LEN: usize> UnwindSafe for Bag<T, ARRAY_LEN>where T: UnwindSafe,
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