std::wit
the component model's async ABI (WASI preview 3)
for the bindings ffi::wit::import / ffi::wit::export generate:
it runs on the executor, so it lives above
bare::ffi::wit.
Structs
WaitingSource
pub struct WaitingAn operation the host completes later: its event's payload.
FutureOpsSource
pub struct FutureOps<T>What one future type's values need: the component model's built-ins for it and its values' layout.
future.new: both ends' handles, packed.future.readinto an address.future.writefrom an address.future.drop-readable.future.drop-writable.A value's size in bytes.
A value's alignment in bytes.
The value at an address (freeing what it points to).
The value stored at an address, into blocks.
Trait implementations 1
impl<T> Debug for FutureOps<T>
StreamOpsSource
pub struct StreamOps<T>stream<T>'s: as FutureOps, copies of many values.
stream.new: both ends' handles, packed.stream.readof up to a count of values into an address.stream.writeof a count of values from an address.stream.drop-readable.stream.drop-writable.A value's size in bytes.
A value's alignment in bytes.
As
FutureOps.lift.As
FutureOps.lower.
Trait implementations 1
impl<T> Debug for StreamOps<T>
Functions
waitSource
pub fn wait(h: i32) -> Waiting Wait for waitable h's next event (an operation on it blocked).
subtaskSource
pub async fn subtask(status: i32) An async import's call: status is its subtask (state and handle);
done once it returned.
async_startSource
pub fn async_start<T>(f: AsyncFuture<T>, ret: fn(T)) -> i32 An async export's call: ret returns the result of f (the
component model's task.return). The status for the host.
async_enterSource
pub fn async_enter() Entering an async export (its call or callback).
async_eventSource
pub fn async_event(code: i32, h: i32, payload: i32) -> i32 The host's event for an async export call (its callback).
catching_asyncSource
pub async fn catching_async<T, E>(f: TryAsyncFuture<T, E>) -> Result<T, E> A throwing async export's future, its error in the result.
future_inSource
pub async fn future_in<T>(ops: FutureOps<T>, h: i32) -> T The readable end of future h as a Nabi future.
future_outSource
pub fn future_out<T>(ops: FutureOps<T>, f: AsyncFuture<T>) -> i32 A new future whose value f's is: its readable end.
stream_inSource
pub fn stream_in<T: Send>(ops: StreamOps<T>, h: i32) -> Receiver<T> The readable end of stream h as a channel, until its writer drops.
stream_outSource
pub fn stream_out<T>(ops: StreamOps<T>, rx: Receiver<T>) -> i32 A new stream of rx's values (until its senders close): its
readable end.