host: expose harness state and actions over the world API

This commit is contained in:
2026-11-07 19:22:06 +00:00
parent c3c5b36d09
commit 5dc4833e28
33 changed files with 33178 additions and 112 deletions
+4 -7
View File
@@ -46,13 +46,10 @@ impl WasiHttpHooks for Hooks {
{
let bytes = body.collect().await?.to_bytes();
let request = Request::from_parts(parts, bytes);
if request.method() == http::Method::POST && request.uri().path() == "/cargo" {
return Ok((
crate::api::stream(&router, request),
Box::new(async { Ok(()) }) as Io,
));
}
return Ok(response(crate::api::handle(&router, caller, request).await));
return Ok((
crate::api::dispatch(&router, caller, request).await,
Box::new(async { Ok(()) }) as Io,
));
}
if !matches!(parts.uri.scheme_str(), Some("http" | "https")) {
while let Some(frame) = body.frame().await {