Struct Any
#[must_use = "strategies do nothing unless used"]
pub struct Any(/* private field */);
Strategies which produce floating-point values from particular
classes. See the various Any-typed constants in this module.
Note that this usage is fairly advanced and primarily useful to
implementors of algorithms that need to handle wild values in a
particular way. For testing things like graphics processing or game
physics, simply using ranges (e.g., -1.0..2.0) will often be more
practical.
Any can be OR'ed to combine multiple classes. For example,
POSITIVE | INFINITE will generate arbitrary positive, non-NaN
floats, including positive infinity (but not negative infinity, of
course).
If neither POSITIVE nor NEGATIVE has been OR'ed into an Any
but a type to be generated requires a sign, POSITIVE is assumed.
If no classes are OR'ed into an Any (i.e., only POSITIVE and/or
NEGATIVE are given), NORMAL is assumed.
The various float classes are assigned fixed weights for generation which are believed to be reasonable for most applications. Roughly:
-
If
POSITIVE | NEGATIVE, the sign is evenly distributed between both options. -
Classes are weighted as follows, in descending order:
NORMAL>ZERO>SUBNORMAL>INFINITE>QUIET_NAN=SIGNALING_NAN.
Trait Implementations
impl BitOr for Any
type Output = Any;fn bitor(self, rhs: Self) -> Self
impl BitOrAssign for Any
fn bitor_assign(&mut self, rhs: Self)
impl Clone for Any
fn clone(&self) -> Self
impl Copy for Any
impl Debug for Any
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Strategy for Any
type Tree = BinarySearch;type Value = f32;fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
Auto Trait Implementations
impl Freeze for Any
impl RefUnwindSafe for Any
impl Send for Any
impl Sync for Any
impl Unpin for Any
impl UnsafeUnpin for Any
impl UnwindSafe for Any
Blanket Implementations
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for Any
where
ST: ?Sized,
DT: ?Sized,
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for Any
where
ST: ?Sized,
DT: ?Sized,
impl<T> Any for Any
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Any
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Any
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Any
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Any
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Read<Exclusive, BecauseExclusive> for Any
where
T: ?Sized,
impl<T> ToOwned for Any
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Any
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Any
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Any
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 Any
where
V: MultiLane<T>,
fn vzip(self) -> V