Struct wasmer_wasi::WasiEnv[][src]

pub struct WasiEnv {
    pub state: Arc<Mutex<WasiState>>,
    // some fields omitted
}

The environment provided to the WASI imports.

Fields

state: Arc<Mutex<WasiState>>

Shared state of the WASI system. Manages all the data that the executing WASI program can see.

Be careful when using this in host functions that call into Wasm: if the lock is held and the Wasm calls into a host function that tries to lock this mutex, the program will deadlock.

Implementations

impl WasiEnv[src]

pub fn memory_ref(&self) -> Option<&Memory>[src]

Get access to the underlying data.

If WasmerEnv::finish has been called, this function will never return None unless the underlying data has been mutated manually.

pub unsafe fn memory_ref_unchecked(&self) -> &Memory[src]

Gets the item without checking if it's been initialized.

Safety

WasmerEnv::finish must have been called on this function or this type manually initialized.

impl WasiEnv[src]

pub fn new(state: WasiState) -> Self[src]

pub fn import_object(
    &mut self,
    module: &Module
) -> Result<ImportObject, WasiError>
[src]

pub fn state(&self) -> MutexGuard<'_, WasiState>[src]

Get the WASI state

Be careful when using this in host functions that call into Wasm: if the lock is held and the Wasm calls into a host function that tries to lock this mutex, the program will deadlock.

pub fn memory(&self) -> &Memory[src]

Get a reference to the memory

Trait Implementations

impl Clone for WasiEnv[src]

impl Debug for WasiEnv[src]

impl WasmerEnv for WasiEnv[src]

Auto Trait Implementations

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> Instrument for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.