Struct Any
struct Any(_)
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.
Implementations
impl BitOr for Any
fn bitor(self: Self, rhs: Self) -> Self
impl BitOrAssign for Any
fn bitor_assign(self: &mut Self, rhs: Self)
impl Clone for Any
fn clone(self: &Self) -> Any
impl Copy for Any
impl Debug for Any
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Freeze for Any
impl RefUnwindSafe for Any
impl Send for Any
impl Strategy for Any
fn new_tree(self: &Self, runner: &mut TestRunner) -> NewTree<Self>
impl Sync for Any
impl Unpin for Any
impl UnwindSafe for Any
impl<T> Any for Any
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Any
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Any
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Any
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Any
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Any
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for Any
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Any
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Any
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<V, T> VZip for Any
fn vzip(self: Self) -> V