pub struct Stacks { /* private fields */ }
Expand description
Generate a Wasm module that keeps track of its current call stack, to compare to the host.
Implementations§
Source§impl Stacks
impl Stacks
Sourcepub fn wasm(&self) -> Vec<u8> ⓘ
pub fn wasm(&self) -> Vec<u8> ⓘ
Get this test case’s Wasm module.
The Wasm module has the following imports:
-
host.check_stack: [] -> []
: The host can check the Wasm’s understanding of its own stack against the host’s understanding of the Wasm stack to find discrepancy bugs. -
host.call_func: [funcref] -> []
: The host should call the givenfuncref
, creating a call stack with multiple sequences of contiguous Wasm frames on the stack like[..., wasm, host, wasm]
.
The Wasm module has the following exports:
-
run: [i32] -> []
: This function should be called with each of the input values to run this generated test case. -
get_stack: [] -> [i32 i32]
: Get the pointer and length of theu32
array of this Wasm’s understanding of its stack. This is useful for checking whether the host’s view of the stack at a trap matches the Wasm program’s understanding.
Trait Implementations§
Source§impl<'a> Arbitrary<'a> for Stacks
impl<'a> Arbitrary<'a> for Stacks
Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
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>
Self
from the entirety of the given
unstructured data. Read moreAuto Trait Implementations§
impl Freeze for Stacks
impl RefUnwindSafe for Stacks
impl Send for Stacks
impl Sync for Stacks
impl Unpin for Stacks
impl UnwindSafe for Stacks
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
§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>
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>
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)
&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)
&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>
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>
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