Struct wasmedge_sdk::wasi::async::WasiContext
source · pub struct WasiContext { /* private fields */ }
Available on crate feature
async
and Linux only.Expand description
Represents a wasi context for the async
scenarios.
Implementations§
source§impl WasiContext
impl WasiContext
sourcepub fn new(
args: Option<Vec<&str>>,
envs: Option<Vec<(&str, &str)>>,
preopens: Option<Vec<(&str, &str)>>
) -> Self
pub fn new( args: Option<Vec<&str>>, envs: Option<Vec<(&str, &str)>>, preopens: Option<Vec<(&str, &str)>> ) -> Self
Creates a wasi context with the specified argumentes, environment variables, and preopened directories.
Arguments
-
args
- The commandline arguments. The first argument is the program name. -
envs
- The environment variables to use. -
preopens
- The directories to pre-open. The first element of the pair is the host directory, while the second is the guest directory.
sourcepub fn generate<S: Into<String>>(
args: Option<Vec<S>>,
envs: Option<Vec<(S, S)>>,
preopens: Option<Vec<(S, S)>>
) -> Self
pub fn generate<S: Into<String>>( args: Option<Vec<S>>, envs: Option<Vec<(S, S)>>, preopens: Option<Vec<(S, S)>> ) -> Self
Creates a wasi context with the specified argumentes, environment variables, and preopened directories.
Arguments
-
args
- The commandline arguments. The first argument is the program name. -
envs
- The environment variables to use. -
preopens
- The directories to pre-open. The first element of the pair is the host directory, while the second is the guest directory.
Trait Implementations§
source§impl Debug for WasiContext
impl Debug for WasiContext
Auto Trait Implementations§
impl !RefUnwindSafe for WasiContext
impl Send for WasiContext
impl Sync for WasiContext
impl Unpin for WasiContext
impl !UnwindSafe for WasiContext
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