pub struct WasiProcess {
pub stdin: Option<WasiStdin>,
pub stdout: Option<WasiStdout>,
pub stderr: Option<WasiStderr>,
/* private fields */
}
Expand description
A wasi process. See crate documentation for more details and examples.
Fields§
§stdin: Option<WasiStdin>
An stdin reader for the wasi process
stdout: Option<WasiStdout>
An stdout writer for the wasi process
stderr: Option<WasiStderr>
An stderr writer for the wasi process
Implementations§
Source§impl WasiProcess
impl WasiProcess
Sourcepub fn new(
instance: &Instance,
buf_size: MaxBufSize,
) -> Result<Self, ExportError>
pub fn new( instance: &Instance, buf_size: MaxBufSize, ) -> Result<Self, ExportError>
Create a WasiProcess from a wasm instance. See the crate documentation for more details.
Returns an error if the instance doesn’t have a _start
function exported.
Sourcepub fn with_function(start_function: Function, buf_size: MaxBufSize) -> Self
pub fn with_function(start_function: Function, buf_size: MaxBufSize) -> Self
Create a WasiProcess from a wasm instance, given a _start
function. See the crate
documentation for more details.
Sourcepub fn spawn(self) -> SpawnHandle ⓘ
pub fn spawn(self) -> SpawnHandle ⓘ
Spawn the process on a tokio task. It’s okay to let this drop; that just means that you don’t care about exactly when or how the process finishes, and you’ll know you’re done when an stdio stream closes;
Trait Implementations§
Source§impl Future for WasiProcess
impl Future for WasiProcess
Auto Trait Implementations§
impl Freeze for WasiProcess
impl !RefUnwindSafe for WasiProcess
impl Send for WasiProcess
impl Sync for WasiProcess
impl Unpin for WasiProcess
impl !UnwindSafe for WasiProcess
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more