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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§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
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Upcastable for T
impl<T> Upcastable for T
Source§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
Source§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref