Skip to content

Commit

Permalink
refactor(preview2): add inherit_std{in,out,err} (bytecodealliance#6465
Browse files Browse the repository at this point in the history
)

Signed-off-by: Roman Volosatovs <[email protected]>
  • Loading branch information
rvolosatovs authored May 26, 2023
1 parent b7d3261 commit f5d9131
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions crates/wasi/src/preview2/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,20 @@ impl WasiCtxBuilder {
self
}

pub fn inherit_stdio(self) -> Self {
pub fn inherit_stdin(self) -> Self {
self.set_stdin(stdio::stdin())
.set_stdout(stdio::stdout())
.set_stderr(stdio::stderr())
}

pub fn inherit_stdout(self) -> Self {
self.set_stdout(stdio::stdout())
}

pub fn inherit_stderr(self) -> Self {
self.set_stderr(stdio::stderr())
}

pub fn inherit_stdio(self) -> Self {
self.inherit_stdin().inherit_stdout().inherit_stderr()
}

pub fn set_env(mut self, env: &[(impl AsRef<str>, impl AsRef<str>)]) -> Self {
Expand Down

0 comments on commit f5d9131

Please sign in to comment.