[][src]Struct wasi_common::WasiCtxBuilder

pub struct WasiCtxBuilder { /* fields omitted */ }

A builder allowing customizable construction of WasiCtx instances.

Methods

impl WasiCtxBuilder[src]

pub fn new() -> Result<Self, Error>[src]

Builder for a new WasiCtx.

pub fn args<S: AsRef<str>>(
    self,
    args: impl Iterator<Item = S>
) -> Result<Self, Error>
[src]

Add arguments to the command-line arguments list.

pub fn arg(self, arg: &str) -> Result<Self, Error>[src]

Add an argument to the command-line arguments list.

pub fn inherit_args(self) -> Result<Self, Error>[src]

Inherit the command-line arguments from the host process.

pub fn inherit_stdio(self) -> Result<Self, Error>[src]

Inherit the stdin, stdout, and stderr streams from the host process.

pub fn inherit_env(self) -> Result<Self, Error>[src]

Inherit the environment variables from the host process.

pub fn env<S: AsRef<str>>(self, k: S, v: S) -> Result<Self, Error>[src]

Add an entry to the environment.

pub fn envs<S: AsRef<str>, T: Borrow<(S, S)>>(
    self,
    envs: impl Iterator<Item = T>
) -> Result<Self, Error>
[src]

Add entries to the environment.

pub fn stdin(self, file: File) -> Result<Self, Error>[src]

Provide a File to use as stdin

pub fn stdout(self, file: File) -> Result<Self, Error>[src]

Provide a File to use as stdout

pub fn stderr(self, file: File) -> Result<Self, Error>[src]

Provide a File to use as stderr

pub fn preopened_dir<P: AsRef<Path>>(self, dir: File, guest_path: P) -> Self[src]

Add a preopened directory.

pub fn build(self) -> Result<WasiCtx, Error>[src]

Build a WasiCtx, consuming this WasiCtxBuilder.

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for T[src]

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.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,