pub struct Module<'a> { /* private fields */ }
Implementations
sourceimpl<'a> Module<'a>
impl<'a> Module<'a>
pub fn new(validate: bool) -> Self
pub fn import_function<T: Into<String>>(
&mut self,
module: T,
external: T,
body: FnBody<'_>
) -> u32
pub fn import_memory<T: Into<String>>(
&mut self,
module: T,
external: T,
descriptor: ResizableLimits
) -> u32
pub fn import_table<T: Into<String>>(
&mut self,
module: T,
external: T,
descriptor: ResizableLimits
) -> u32
pub fn import_global<T: Into<String>>(
&mut self,
module: T,
external: T,
descriptor: GlobalDescriptor
) -> u32
sourcepub fn add_function(
&mut self,
fn_body: FnBody<'a>,
export_name: Option<&str>
) -> u32
pub fn add_function(
&mut self,
fn_body: FnBody<'a>,
export_name: Option<&str>
) -> u32
Footgun. Needs to be used after add_import
otherwise this may generate a corrupt binary
pub fn add_global_descriptor(
&mut self,
descriptor: GlobalDescriptor,
export_name: Option<&str>
) -> u32
pub fn add_table(&mut self, table: Table, export_name: Option<&str>) -> u32
pub fn add_memory(&mut self, memory: Memory, export_name: Option<&str>) -> u32
pub fn compile(self) -> Result<Vec<u8>, Error>
pub fn validate(&self) -> Result<(), ValidationError>
pub fn compile_stream(self, writer: &mut impl Write) -> Result<(), Error>
Auto Trait Implementations
impl<'a> RefUnwindSafe for Module<'a>
impl<'a> Send for Module<'a>
impl<'a> Sync for Module<'a>
impl<'a> Unpin for Module<'a>
impl<'a> UnwindSafe for Module<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more