[][src]Struct binaryen::Module

pub struct Module { /* fields omitted */ }

Modules contain lists of functions, imports, exports, function types.

Methods

impl Module[src]

pub fn read(module: &[u8]) -> Result<Module, ()>[src]

Deserialize a module from binary form.

Returns Err if an invalid module is given.

pub unsafe fn from_raw(raw: BinaryenModuleRef) -> Module[src]

pub fn optimize(&self)[src]

Run the standard optimization passes on the module.

It will take into account code generation configuration set by set_global_codegen_config.

pub fn run_optimization_passes<B: AsRef<str>, I: IntoIterator<Item = B>>(
    &self,
    passes: I
) -> Result<(), ()>
[src]

Run a specified set of optimization passes on the module.

This WILL NOT take into account code generation configuration set by set_global_codegen_config.

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

Serialize a module into binary form.

Auto Trait Implementations

impl !Send for Module

impl !Sync for Module

Blanket Implementations

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.

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

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

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