pub struct Env {
pub imports: Imports,
pub exports: Exports,
pub slots: Slots,
pub funcs: Funcs,
pub data: Data,
pub index: Option<u32>,
}
Expand description
A struct that holds the environment wasm module.
Fields§
§imports: Imports
WASM imports
exports: Exports
WASM exports
slots: Slots
Function memory slots
funcs: Funcs
Function params count
data: Data
WASM data slots
index: Option<u32>
Current function index
Implementations§
Source§impl Env
impl Env
Sourcepub fn query_func(&self, name: &str) -> Result<u32>
pub fn query_func(&self, name: &str) -> Result<u32>
Query exported function from selector.
Sourcepub fn is_external(&self, index: u32) -> bool
pub fn is_external(&self, index: u32) -> bool
Check if the input function is external function
Sourcepub fn is_main(&self, index: u32) -> bool
pub fn is_main(&self, index: u32) -> bool
If the present function index is the main function
NOTE: in wasm the indexes of the imports will be ordered before the functions
Sourcepub fn with_index(&self, index: u32) -> Self
pub fn with_index(&self, index: u32) -> Self
Clone a new environment with function index provided
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Env
impl RefUnwindSafe for Env
impl Send for Env
impl Sync for Env
impl Unpin for Env
impl UnwindSafe for Env
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