pub enum DiffValue {
I32(i32),
I64(i64),
F32(u32),
F64(u64),
V128(u128),
FuncRef {
null: bool,
},
ExternRef {
null: bool,
},
AnyRef {
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 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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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