Struct wasi_common::WasiCtxBuilder
source · pub struct WasiCtxBuilder { /* private fields */ }
Expand description
A builder allowing customizable construction of WasiCtx
instances.
Implementations§
source§impl WasiCtxBuilder
impl WasiCtxBuilder
sourcepub fn args<S: AsRef<str>>(
self,
args: impl Iterator<Item = S>,
) -> Result<Self, Error>
pub fn args<S: AsRef<str>>( self, args: impl Iterator<Item = S>, ) -> Result<Self, Error>
Add arguments to the command-line arguments list.
sourcepub fn arg(self, arg: &str) -> Result<Self, Error>
pub fn arg(self, arg: &str) -> Result<Self, Error>
Add an argument to the command-line arguments list.
sourcepub fn inherit_args(self) -> Result<Self, Error>
pub fn inherit_args(self) -> Result<Self, Error>
Inherit the command-line arguments from the host process.
sourcepub fn inherit_stdio(self) -> Result<Self, Error>
pub fn inherit_stdio(self) -> Result<Self, Error>
Inherit the stdin, stdout, and stderr streams from the host process.
sourcepub fn inherit_env(self) -> Result<Self, Error>
pub fn inherit_env(self) -> Result<Self, Error>
Inherit the environment variables from the host process.
sourcepub fn env<S: AsRef<str>>(self, k: S, v: S) -> Result<Self, Error>
pub fn env<S: AsRef<str>>(self, k: S, v: S) -> Result<Self, Error>
Add an entry to the environment.
sourcepub fn envs<S: AsRef<str>, T: Borrow<(S, S)>>(
self,
envs: impl Iterator<Item = T>,
) -> Result<Self, Error>
pub fn envs<S: AsRef<str>, T: Borrow<(S, S)>>( self, envs: impl Iterator<Item = T>, ) -> Result<Self, Error>
Add entries to the environment.
sourcepub fn preopened_dir<P: AsRef<Path>>(self, dir: File, guest_path: P) -> Self
pub fn preopened_dir<P: AsRef<Path>>(self, dir: File, guest_path: P) -> Self
Add a preopened directory.
Auto Trait Implementations§
impl Freeze for WasiCtxBuilder
impl RefUnwindSafe for WasiCtxBuilder
impl Send for WasiCtxBuilder
impl Sync for WasiCtxBuilder
impl Unpin for WasiCtxBuilder
impl UnwindSafe for WasiCtxBuilder
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