chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

19
vendor/wasip3/examples/cli-command.rs vendored Normal file
View File

@@ -0,0 +1,19 @@
wasip3::cli::command::export!(Example);
struct Example;
impl wasip3::exports::cli::run::Guest for Example {
async fn run() -> Result<(), ()> {
let (mut tx, rx) = wasip3::wit_stream::new();
futures::join!(
async { wasip3::cli::stdout::write_via_stream(rx).await.unwrap() },
async {
let remaining = tx.write_all(b"Hello, WASI!".to_vec()).await;
assert!(remaining.is_empty());
drop(tx);
}
);
Ok(())
}
}

View File

@@ -0,0 +1,20 @@
use wasip3::http::types::{self, ErrorCode};
use wasip3::http_compat::{http_from_wasi_request, http_into_wasi_response, IncomingRequestBody};
wasip3::http::service::export!(Example);
struct Example;
impl wasip3::exports::http::handler::Guest for Example {
async fn handle(request: types::Request) -> Result<types::Response, ErrorCode> {
let request = http_from_wasi_request(request)?;
let response = serve(request).await?;
http_into_wasi_response(response)
}
}
async fn serve(
_request: http::Request<IncomingRequestBody>,
) -> Result<http::Response<String>, ErrorCode> {
Ok(http::Response::new("Hello, WASI!".to_string()))
}

22
vendor/wasip3/examples/http-proxy.rs vendored Normal file
View File

@@ -0,0 +1,22 @@
use wasip3::http::types::{ErrorCode, Fields, Request, Response};
use wasip3::{wit_bindgen, wit_future, wit_stream};
wasip3::http::service::export!(Example);
struct Example;
impl wasip3::exports::http::handler::Guest for Example {
async fn handle(_request: Request) -> Result<Response, ErrorCode> {
let (mut body_tx, body_rx) = wit_stream::new();
let (body_result_tx, body_result_rx) = wit_future::new(|| Ok(None));
let (response, _future_result) =
Response::new(Fields::new(), Some(body_rx), body_result_rx);
drop(body_result_tx);
wit_bindgen::spawn(async move {
let remaining = body_tx.write_all(b"Hello, WASI!".to_vec()).await;
assert!(remaining.is_empty());
});
Ok(response)
}
}