Crate wasmtime_wasi
source ·Expand description
§Wasmtime’s WASI Implementation
This crate provides a Wasmtime host implementation of WASI 0.2 (aka Preview 2), and a compatibility shim that provides an implementation of WASI 0.1 (aka Preview 1).
Modules§
- Virtual pipes.
Structs§
- An impl of
StdinStreambuilt on top ofcrate::pipe::AsyncReadStream. - A wrapper of
crate::pipe::AsyncWriteStreamthat implementsStdoutStream. Note that theHostOutputStreamimpl for this is not correct when used for interleaved async IO. - Implement
insecure-randomusing a deterministic cycle of bytes. - An error returned from the
proc_exithost syscall. - A host representation of the
wasi:io/poll.pollableresource. - The
ResourceTabletype maps aResource<T>to itsT. - This implementation will yield output streams that block on writes, as they inherit the implementation directly from the rust std library. A different implementation of
StdoutStreamwill be necessary if truly async output streams are required. - Only public interface is the
HostInputStreamimpl. - This implementation will yield output streams that block on writes, as they inherit the implementation directly from the rust std library. A different implementation of
StdoutStreamwill be necessary if truly async output streams are required. - A helper error type used by many other modules through type aliases.
Enums§
- Errors returned by operations on
ResourceTable - A value for specifying a time.
Traits§
- Host trait for implementing the
wasi:io/streams.input-streamresource: A bytestream which can be read from. - Host trait for implementing the
wasi:io/streams.output-streamresource: A bytestream which can be written to. - The core of a random number generator.
- A trait used to represent the standard input to a guest program.
- Similar to
StdinStream, except for output.
Functions§
- Attempts to get the result of a
future. - Creates a
pollableresource which is susbcribed to the providedresource. - Executes the closure
fwith an “ambient Tokio runtime” which basically means that if code inftries to get a runtimeHandleit’ll succeed.