WASI Preview 2 (wasi:http/incoming-handler@0.2.0) adapter bridging unmbt/ciallo Apps to Wasmtime, Spin, and WASI HTTP hosts
pub(open) trait WasiStreamHost {
fn request_method(Self, req : WasiHandle) -> WasiMethod raise WasiErrorCode
fn request_scheme(Self, req : WasiHandle) -> WasiScheme raise WasiErrorCode
fn request_authority(Self, req : WasiHandle) -> String raise WasiErrorCode
fn request_path_with_query(Self, req : WasiHandle) -> String raise WasiErrorCode
fn request_headers(Self, req : WasiHandle) -> WasiFields raise WasiErrorCode
fn request_consume_body(Self, req : WasiHandle) -> WasiHandle raise WasiErrorCode
fn incoming_body_stream(Self, body : WasiHandle) -> WasiHandle raise WasiErrorCode
fn input_stream_blocking_read(Self, stream : WasiHandle, max_len : Int64) -> WasiStreamRead raise WasiErrorCode
fn drop_input_stream(Self, stream : WasiHandle) -> Unit
fn incoming_body_finish(Self, body : WasiHandle) -> Unit
fn new_outgoing_response(Self, status : Int, headers : WasiFields) -> WasiHandle raise WasiErrorCode
fn outgoing_response_body(Self, resp : WasiHandle) -> WasiHandle raise WasiErrorCode
fn response_outparam_set_ok(Self, outparam : WasiHandle, resp : WasiHandle) -> Unit
fn response_outparam_set_err(Self, outparam : WasiHandle, err : WasiErrorCode) -> Unit
fn outgoing_body_write(Self, body : WasiHandle) -> WasiHandle raise WasiErrorCode
fn output_stream_check_write(Self, stream : WasiHandle) -> Int64 raise WasiErrorCode
fn output_stream_blocking_write_and_flush(Self, stream : WasiHandle, chunk : BytesView) -> Unit raise WasiErrorCode
fn output_stream_subscribe(Self, stream : WasiHandle) -> WasiHandle
fn pollable_block(Self, pollable : WasiHandle) -> Unit
fn drop_pollable(Self, pollable : WasiHandle) -> Unit
fn drop_output_stream(Self, stream : WasiHandle) -> Unit
fn outgoing_body_finish(Self, body : WasiHandle) -> Unit raise WasiErrorCode
}async fn WasiIncomingHandler::handle(self : WasiIncomingHandler, request : WasiIncomingRequest, response_out : WasiResponseOutparam) -> Unitpub struct WasiIncomingRequest {
meth : WasiMethod
scheme : WasiScheme
authority : String
path_with_query : String
headers : WasiFields
body_chunks : Array[Bytes]
}fn WasiIncomingRequest::WasiIncomingRequest(meth? : WasiMethod, scheme? : WasiScheme, authority? : String, path_with_query? : String, headers? : WasiFields, body_chunks? : Array[Bytes]) -> WasiIncomingRequestpub struct WasiOutgoingResponse {
status_code : Int
headers : WasiFields
body_chunks : Array[Bytes]
} derive(Eq, Debug)fn WasiResponseOutparam::set(self : WasiResponseOutparam, res : Result[WasiOutgoingResponse, WasiErrorCode]) -> Unitfn WasiResponseOutparam::take(self : WasiResponseOutparam) -> Result[WasiOutgoingResponse, WasiErrorCode]?async fn handle_incoming_request(app : App, req : WasiIncomingRequest, env? : Env) -> WasiOutgoingResponse raise WasiErrorCodeasync fn handle_wasi_component_request(app : App, host : &WasiStreamHost, incoming_req : WasiHandle, response_out : WasiHandle, env? : Env, read_chunk_bytes? : Int64) -> UnitInstall
Download zipWASI Preview 2 (wasi:http/incoming-handler@0.2.0) adapter bridging unmbt/ciallo Apps to Wasmtime, Spin, and WASI HTTP hosts