Expand description
Source host state, linker functions, and host imports.
This module provides:
SourceHostState: host state for the source world (separate fromWasmHostState)SourceChannels: bounded tokio channels bridging async guest imports to host tasksHostWithStoreimpl for asyncaccept-http,submit-exchange; syncHostimpl foris-cancelledrun_http_listener: async axum task feeding HTTP requests into the channelrun_pipeline_bridge: async task forwarding exchanges to the pipeline
Structs§
- Http
Listener Handle - Concrete type for the http-listener resource in the ResourceTable.
Stateless — the handle is a marker that the guest holds while running.
Mapped via
with:in source_bindings.rs to replace the empty enum generated by bindgen for theresource http-listenerdeclaration. - Http
Meta - Materialized HTTP request metadata (everything except the body).
- Source
Channels - Paired channel endpoints for bridging the guest to async host tasks.
- Source
Host State - Host state for a source consumer. Lives inside the
wasmtime::Store.
Constants§
- DEFAULT_
MAX_ REQUEST_ BODY_ BYTES - Default maximum request body size in bytes (10 MiB).
- EXCHANGE_
CHANNEL_ CAPACITY - Capacity for the exchange channel (guest → pipeline bridge). 1 enforces strict backpressure — guest blocks until pipeline accepts.
- REQUEST_
CHANNEL_ CAPACITY - Capacity for the HTTP request channel (host listener → guest).
Functions§
- add_
to_ linker - Register the source-host interface and WASI p2 into a linker for
SourceHostState. - run_
http_ listener - Run an axum HTTP server that feeds incoming requests into
request_tx. - run_
pipeline_ bridge - Receive native exchanges from the guest’s
submit-exchangeimport and forward them to the pipeline viaConsumerContext.