Struct BitSetStrategy

#[must_use = "strategies do nothing unless used"]
pub struct BitSetStrategy<T: BitSetLike> { /* private fields */ }

Generates values as a set of bits between the two bounds.

Values are generated by uniformly setting individual bits to 0 or 1 between the bounds. Shrinking iteratively clears bits.

Implementations

impl<T: BitSetLike> BitSetStrategy<T>

fn new(min: usize, max: usize) -> Self

Create a strategy which generates values where bits between min (inclusive) and max (exclusive) may be set.

Due to the generics, the functions in the typed submodules are usually preferable to calling this directly.

fn masked(mask: T) -> Self

Create a strategy which generates values where any bits set (and only those bits) in mask may be set.

Trait Implementations

impl<T: BitSetLike> Strategy for BitSetStrategy<T>

type Tree = BitSetValueTree<T>;
type Value = T;
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>

impl<T: Clone + BitSetLike> Clone for BitSetStrategy<T>

fn clone(&self) -> Self

impl<T: Copy + BitSetLike> Copy for BitSetStrategy<T>

impl<T: Debug + BitSetLike> Debug for BitSetStrategy<T>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<T> Freeze for BitSetStrategy<T> where Option<T>: Freeze,

impl<T> RefUnwindSafe for BitSetStrategy<T> where Option<T>: RefUnwindSafe,

impl<T> Send for BitSetStrategy<T> where Option<T>: Send,

impl<T> Sync for BitSetStrategy<T> where Option<T>: Sync,

impl<T> Unpin for BitSetStrategy<T> where Option<T>: Unpin,

impl<T> UnsafeUnpin for BitSetStrategy<T> where Option<T>: UnsafeUnpin,

impl<T> UnwindSafe for BitSetStrategy<T> where Option<T>: UnwindSafe,

Blanket Implementations

impl<T> Any for BitSetStrategy<T> where T: 'static + ?Sized,

impl<T> Borrow<T> for BitSetStrategy<T> where T: ?Sized,

impl<T> BorrowMut<T> for BitSetStrategy<T> where T: ?Sized,

impl<T> CloneToUninit for BitSetStrategy<T> where T: Clone,

impl<T> From<T> for BitSetStrategy<T>

impl<T> ToOwned for BitSetStrategy<T> where T: Clone,

impl<T, U> Into<U> for BitSetStrategy<T> where U: From<T>,

impl<T, U> TryFrom<U> for BitSetStrategy<T> where U: Into<T>,

impl<T, U> TryInto<U> for BitSetStrategy<T> where U: TryFrom<T>,