pub struct SetData {
pub items: Vec<ValueWord>,
pub index: HashMap<u64, Vec<usize>>,
}Expand description
Data for Set variant (boxed to keep HeapValue small).
Uses bucket chaining for collision-safe O(1) membership tests.
Fields§
§items: Vec<ValueWord>§index: HashMap<u64, Vec<usize>>Implementations§
Source§impl SetData
impl SetData
Sourcepub fn insert(&mut self, item: ValueWord) -> bool
pub fn insert(&mut self, item: ValueWord) -> bool
Add an item to the set. Returns true if the item was newly inserted.
Sourcepub fn remove(&mut self, item: &ValueWord) -> bool
pub fn remove(&mut self, item: &ValueWord) -> bool
Remove an item from the set. Returns true if the item was present.
Sourcepub fn rebuild_index(items: &[ValueWord]) -> HashMap<u64, Vec<usize>>
pub fn rebuild_index(items: &[ValueWord]) -> HashMap<u64, Vec<usize>>
Build a bucketed index from the items vector.
Sourcepub fn from_items(items: Vec<ValueWord>) -> Self
pub fn from_items(items: Vec<ValueWord>) -> Self
Create from items, deduplicating.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SetData
impl RefUnwindSafe for SetData
impl Send for SetData
impl Sync for SetData
impl Unpin for SetData
impl UnsafeUnpin for SetData
impl UnwindSafe for SetData
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