pub struct BitSet<const W: usize>(/* private fields */);Expand description
A domain of 64 * W values, for variables with more values than a u128 holds.
§Examples
use constraint_search::{BitSet, Domain};
let mut slots = BitSet::<4>::range(200);
slots.remove(150);
assert_eq!(slots.len(), 199);
assert!(!slots.contains(150));Trait Implementations§
impl<const W: usize> Copy for BitSet<W>
Source§impl<const W: usize> Domain for BitSet<W>
impl<const W: usize> Domain for BitSet<W>
Source§fn contains(&self, value: u32) -> bool
fn contains(&self, value: u32) -> bool
Returns
true if value is in the domain. Values at or above the capacity never are.Source§fn remove(&mut self, value: u32)
fn remove(&mut self, value: u32)
Takes
value out of the domain. Removing an absent value does nothing.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
The values in both
self and other.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
The values in
self but not in other.impl<const W: usize> Eq for BitSet<W>
impl<const W: usize> StructuralPartialEq for BitSet<W>
Auto Trait Implementations§
impl<const W: usize> Forget for BitSet<W>
impl<const W: usize> Freeze for BitSet<W>
impl<const W: usize> Move for BitSet<W>
impl<const W: usize> RefUnwindSafe for BitSet<W>
impl<const W: usize> Send for BitSet<W>
impl<const W: usize> Sync for BitSet<W>
impl<const W: usize> Unpin for BitSet<W>
impl<const W: usize> UnsafeUnpin for BitSet<W>
impl<const W: usize> UnwindSafe for BitSet<W>
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