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) -> BitSetStrategy<T>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for BitSetStrategy<T> where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for BitSetStrategy<T> where ST: ?Sized, DT: ?Sized,

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

fn borrow_mut(&mut self) -> &mut T

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

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Read<Exclusive, BecauseExclusive> for BitSetStrategy<T> where T: ?Sized,

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

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

impl<V, T> VZip<V> for BitSetStrategy<T> where V: MultiLane<T>,

fn vzip(self) -> V