[][src]Struct wasm_smith::Module

pub struct Module { /* fields omitted */ }

A pseudo-random WebAssembly module.

Construct instances of this type with the Arbitrary trait.

Configuring Generated Modules

This uses the DefaultConfig configuration. If you want to customize the shape of generated modules, define your own configuration type, implement the Config trait for it, and use ConfiguredModule<YourConfigType> instead of plain Module.

Implementations

impl Module[src]

pub fn to_bytes(&self) -> Vec<u8>[src]

Encode this Wasm module into bytes.

impl Module[src]

pub fn ensure_termination(&mut self, default_fuel: u32) -> u32[src]

Ensure that all of this Wasm module's functions will terminate when executed.

This adds a new mutable, exported global to the module to keep track of how much "fuel" is left. Fuel is decremented at the head of each loop and function. When fuel reaches zero, a trap is raised.

The index of the fuel global is returned, so that you may control how much fuel the module is given.

Trait Implementations

impl Arbitrary for Module[src]

impl Debug for Module[src]

impl Default for Module[src]

Auto Trait Implementations

impl RefUnwindSafe for Module

impl Send for Module

impl Sync for Module

impl Unpin for Module

impl UnwindSafe for Module

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.