[][src]Struct wasi_process::WasiProcess

#[must_use =
  "WasiProcess does nothing without being polled or spawned. Try calling `.spawn()`"]pub struct WasiProcess {
    pub stdin: Option<WasiStdin>,
    pub stdout: Option<WasiStdout>,
    pub stderr: Option<WasiStderr>,
    // some fields omitted
}

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

impl WasiProcess[src]

pub fn new(
    instance: &Instance,
    buf_size: MaxBufSize
) -> Result<Self, ExportError>
[src]

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.

pub fn with_function(start_function: Function, buf_size: MaxBufSize) -> Self[src]

Create a WasiProcess from a wasm instance, given a _start function. See the crate documentation for more details.

pub fn spawn(self) -> SpawnHandle

Notable traits for SpawnHandle

impl Future for SpawnHandle type Output = Result<(), SpawnError>;
[src]

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

impl Future for WasiProcess[src]

type Output = Result<(), RuntimeError>

The type of value produced on completion.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T> FutureExt for T where
    T: Future + ?Sized

impl<T> Instrument for T[src]

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

impl<F> IntoFuture for F where
    F: Future
[src]

type Output = <F as Future>::Output

🔬 This is a nightly-only experimental API. (into_future)

The output that the future will produce on completion.

type Future = F

🔬 This is a nightly-only experimental API. (into_future)

Which kind of future are we turning this into?

impl<T> Pointable for T

type Init = T

The type for initializers.

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<F, T, E> TryFuture for F where
    F: Future<Output = Result<T, E>> + ?Sized

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<Fut> TryFutureExt for Fut where
    Fut: TryFuture + ?Sized

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.