docs

You are reading the docs for v0.1.0. Nabi 0.1.0 is no longer supported. Latest release: v0.1.3 →

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 Waiting

An operation the host completes later: its event's payload.

Trait implementations 2

FutureOpsSource

pub struct FutureOps<T>

What one future type's values need: the component model's built-ins for it and its values' layout.

  • pub new: fn() -> i64§

    Source

    future.new: both ends' handles, packed.

  • pub read: fn(i32, i32) -> i32§

    Source

    future.read into an address.

  • pub write: fn(i32, i32) -> i32§

    Source

    future.write from an address.

  • pub drop_readable: fn(i32)§

    Source

    future.drop-readable.

  • pub drop_writable: fn(i32)§

    Source

    future.drop-writable.

  • pub size: i32§

    Source

    A value's size in bytes.

  • pub align: i32§

    Source

    A value's alignment in bytes.

  • pub lift: fn(i32) -> T§

    Source

    The value at an address (freeing what it points to).

  • pub lower: fn(T, i32, Blocks)§

    Source

    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.

  • pub new: fn() -> i64§

    Source

    stream.new: both ends' handles, packed.

  • pub read: fn(i32, i32, i32) -> i32§

    Source

    stream.read of up to a count of values into an address.

  • pub write: fn(i32, i32, i32) -> i32§

    Source

    stream.write of a count of values from an address.

  • pub drop_readable: fn(i32)§

    Source

    stream.drop-readable.

  • pub drop_writable: fn(i32)§

    Source

    stream.drop-writable.

  • pub size: i32§

    Source

    A value's size in bytes.

  • pub align: i32§

    Source

    A value's alignment in bytes.

  • pub lift: fn(i32) -> T§

    Source

    As FutureOps.lift.

  • pub lower: fn(T, i32, Blocks)§

    Source

    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.