Type Alias wasmedge_sys::WasiCtx

source ·
pub type WasiCtx = WasiCtx;
Available on crate feature async and Linux only.
Expand description

Type of wasi context that is used to configure the wasi environment.

Aliased Type§

struct WasiCtx {
    pub args: Vec<String>,
    pub io_state: IoState,
    pub exit_code: u32,
    /* private fields */
}

Fields§

§args: Vec<String>§io_state: IoState§exit_code: u32

Implementations

source§

impl WasiCtx

source

pub fn new() -> WasiCtx

source

pub fn push_preopen(&mut self, host_path: PathBuf, guest_path: PathBuf)

source

pub fn push_arg(&mut self, arg: String)

source

pub fn push_args(&mut self, args: Vec<String>)

source

pub fn push_env(&mut self, env: String)

The format of the env argument should be “KEY=VALUE”

source

pub fn push_envs(&mut self, envs: Vec<String>)

source

pub fn get_mut_vfd(&mut self, fd: i32) -> Result<&mut VFD, Errno>

source

pub fn get_vfd(&self, fd: i32) -> Result<&VFD, Errno>

source

pub fn insert_vfd(&mut self, vfd: VFD) -> Result<i32, Errno>

source

pub fn remove_vfd(&mut self, fd: i32) -> Result<(), Errno>

source

pub fn renumber_vfd(&mut self, from: i32, to: i32) -> Result<(), Errno>

Trait Implementations

source§

impl Sync for WasiCtx

source§

impl Clone for WasiCtx

source§

fn clone(&self) -> WasiCtx

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for WasiCtx

source§

fn default() -> WasiCtx

Returns the “default value” for a type. Read more
source§

impl Debug for WasiCtx

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Send for WasiCtx