Skip to content

fidius-guest::client_stream

Rust

Guest-side consumer for client-streaming over WASM (FIDIUS-I-0030 CS2.3).

WASM can’t share a raw FidiusStreamHandle across the sandbox (no shared memory like cdylib), so the guest imports a host function and pulls through it. The component imports fidius:stream-pull/pull.next() -> option<list<u8>>; WasmHostStream presents the bincode items the host produces as an Iterator, which the macro wraps in the Stream<T> the method consumes. This generate! composes with the macro’s interface-export generate! exactly like fidius_guest::http’s wasi:http import (I-0028).

pub

Guest consumer of a host-produced stream — the client-streaming Stream<T> argument. Each next() pulls one bincode item via the imported host func and deserializes it into T; None from the import = end of stream.

pub

fn new() -> Self

Construct a consumer over the host’s fidius:stream-pull import.

Source
pub fn new() -> Self {
Self {
_marker: PhantomData,
}
}