Struct wasmer_wasi::WasiEnv [−][src]
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]
&mut self,
module: &Module
) -> Result<ImportObject, WasiError>
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]
fn init_with_instance(
&mut self,
instance: &Instance
) -> Result<(), HostEnvInitError>
[src]
&mut self,
instance: &Instance
) -> Result<(), HostEnvInitError>
Auto Trait Implementations
impl !RefUnwindSafe for WasiEnv
[src]
impl Send for WasiEnv
[src]
impl Sync for WasiEnv
[src]
impl Unpin for WasiEnv
[src]
impl !UnwindSafe for WasiEnv
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,