Trait proptest::bits::BitSetLike [−][src]
pub trait BitSetLike: Clone + Debug { fn new_bitset(max: usize) -> Self; fn len(&self) -> usize; fn test(&self, ix: usize) -> bool; fn set(&mut self, ix: usize); fn clear(&mut self, ix: usize); fn count(&self) -> usize { ... } }
Trait for types which can be handled with BitSetStrategy
.
Required Methods
fn new_bitset(max: usize) -> Self
Create a new value of Self
with space for up to max
bits, all
initialised to zero.
fn len(&self) -> usize
Return an upper bound on the greatest bit set plus one.
fn test(&self, ix: usize) -> bool
Test whether the given bit is set.
fn set(&mut self, ix: usize)
Set the given bit.
fn clear(&mut self, ix: usize)
Clear the given bit.
Provided Methods
fn count(&self) -> usize
Return the number of bits set.
This has a default for backwards compatibility, which simply does a linear scan through the bits. Implementations are strongly encouraged to override this.
Implementations on Foreign Types
impl BitSetLike for u8
[src]
impl BitSetLike for u8
impl BitSetLike for u16
[src]
impl BitSetLike for u16
impl BitSetLike for u32
[src]
impl BitSetLike for u32
impl BitSetLike for u64
[src]
impl BitSetLike for u64
impl BitSetLike for usize
[src]
impl BitSetLike for usize
impl BitSetLike for i8
[src]
impl BitSetLike for i8
impl BitSetLike for i16
[src]
impl BitSetLike for i16
impl BitSetLike for i32
[src]
impl BitSetLike for i32
impl BitSetLike for i64
[src]
impl BitSetLike for i64
impl BitSetLike for isize
[src]
impl BitSetLike for isize
impl BitSetLike for BitSet
[src]
impl BitSetLike for BitSet