pub enum DiffValue {
I32(i32),
I64(i64),
F32(u32),
F64(u64),
V128(u128),
FuncRef {
null: bool,
},
ExternRef {
null: bool,
},
AnyRef {
null: bool,
},
ExnRef {
null: bool,
},
ContRef {
null: bool,
},
}Expand description
A value passed to and from evaluation. Note that reference types are not (yet) supported.
Variants§
Implementations§
Source§impl DiffValue
impl DiffValue
Sourcepub fn arbitrary_of_type(
u: &mut Unstructured<'_>,
ty: DiffValueType,
) -> Result<Self>
pub fn arbitrary_of_type( u: &mut Unstructured<'_>, ty: DiffValueType, ) -> Result<Self>
Generate a DiffValue of the given ty type.
This function will bias the returned value 50% of the time towards one of a set of known values (e.g., NaN, -1, 0, infinity, etc.).
Trait Implementations§
Source§impl<'a> Arbitrary<'a> for DiffValue
impl<'a> Arbitrary<'a> for DiffValue
Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read more§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§impl PartialEq for DiffValue
Implement equality checks. Note that floating-point values are not compared
bit-for-bit in the case of NaNs: because Wasm floating-point numbers may be
arithmetic NaNs with arbitrary payloads and Wasm operations are not
required to propagate NaN payloads, we simply check that both sides are
NaNs here. We could be more strict, though: we could check that the NaN
signs are equal and that canonical NaN payloads remain canonical.
impl PartialEq for DiffValue
Implement equality checks. Note that floating-point values are not compared bit-for-bit in the case of NaNs: because Wasm floating-point numbers may be arithmetic NaNs with arbitrary payloads and Wasm operations are not required to propagate NaN payloads, we simply check that both sides are NaNs here. We could be more strict, though: we could check that the NaN signs are equal and that canonical NaN payloads remain canonical.
Auto Trait Implementations§
impl Freeze for DiffValue
impl RefUnwindSafe for DiffValue
impl Send for DiffValue
impl Sync for DiffValue
impl Unpin for DiffValue
impl UnsafeUnpin for DiffValue
impl UnwindSafe for DiffValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more