Skip to content

add WASI-HTTP interface documentation and usage example#56

Merged
ruslanti merged 8 commits intomainfrom
feat/wasi-http-example
Mar 20, 2026
Merged

add WASI-HTTP interface documentation and usage example#56
ruslanti merged 8 commits intomainfrom
feat/wasi-http-example

Conversation

@ruslanti
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds module-level documentation describing an alternative WASI-HTTP (wstd) interface path alongside the existing FastEdge SDK usage, including a minimal async fetch example and build instructions using cargo-component.

Changes:

  • Documented a WASI-HTTP (wstd) async handler alternative to the FastEdge SDK.
  • Added a minimal wstd client example plus cargo-component build steps.
  • Added related reference links (WASI-HTTP, wstd, cargo-component, fetch example).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ruslanti and others added 2 commits March 20, 2026 13:43
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +77 to +89
//! ```no_run
//! use wstd::http::body::Body;
//! use wstd::http::{Client, Request, Response};
//!
//! #[wstd::http_server]
//! async fn main(_request: Request<Body>) -> anyhow::Result<Response<Body>> {
//! let upstream_req = Request::get("https://api.example.com/data")
//! .header("accept", "application/json")
//! .body(Body::empty())?;
//!
//! let response = Client::new().send(upstream_req).await?;
//! Ok(response)
//! }
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new rustdoc example is marked no_run, so it still must compile during doctests, but the fastedge crate does not declare wstd (or anyhow) as a (dev-)dependency. As written, cargo test will fail when running doc tests. Consider switching the block to ignore (or adding the needed crates under [dev-dependencies], possibly behind a feature) so docs don’t introduce uncompilable examples.

Copilot uses AI. Check for mistakes.
@ruslanti ruslanti marked this pull request as ready for review March 20, 2026 11:57
@ruslanti ruslanti merged commit ea4873f into main Mar 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants