Bag
Associated Functions for the Bag type
Built-in associated functions for the Bag<T, N> type.
An unordered collection optimized for fast insertion and removal using swap-remove.
Operations
add
fn add(mut self, element: T)
Adds an element to the bag.
erase
fn erase(mut self, index: Int)
Removes the element at the specified index using swap-remove (fast, but doesn’t preserve order).
For additional associated functions like len, is_empty, filter, find, etc., see Sequential functions.