Skip to content

docs(templates): reorganize Rust templates and add HTTP handler set#5084

Merged
ricochet merged 5 commits into
wasmCloud:mainfrom
ericgregory:reorg/rust-templates
Apr 30, 2026
Merged

docs(templates): reorganize Rust templates and add HTTP handler set#5084
ricochet merged 5 commits into
wasmCloud:mainfrom
ericgregory:reorg/rust-templates

Conversation

@ericgregory

@ericgregory ericgregory commented Apr 28, 2026

Copy link
Copy Markdown
Contributor
  • Move examples/http-hello-world to templates/http-hello-world
  • Move and rename examples/key-value to templates/http-kv-handler (Cargo package and WIT world renamed for parity with TypeScript naming; default BACKEND corrected to in_memory to match the README)
  • Add templates/http-client for outgoing HTTP via wstd::http::Client
  • Add templates/http-handler for HTTP routing with axum via wstd-axum
  • Update templates/README.md and root README.md to reference the new paths

Brings Rust template coverage closer to parity with the TypeScript template set. Each template was verified end-to-end with wash dev against wash 2.0.4.

Comment thread templates/http-kv-handler/.wash/config.yaml
ericgregory added a commit to ericgregory/wasmcloud.com that referenced this pull request Apr 29, 2026
Tracks the template renames in wasmCloud/wasmCloud#5084: http-service
becomes http-handler and http-kv-service becomes http-kv-handler. The
"service" suffix collided with wasmCloud's defined notion of a service
(a long-running, stateful Wasm binary), and these are stateless
HTTP-handler components. "handler" matches the WIT export name
(wasi:http/incoming-handler).

Updates the Rust index.mdx routing example link and every reference in
key-value-storage.mdx (template path, world name, package name, and
the template URL).

TypeScript template renames and TS doc updates are tracked as a
follow-up in wasmCloud/typescript.

Signed-off-by: Eric Gregory <eric@cosmonic.com>
@ericgregory ericgregory changed the title docs(templates): reorganize Rust templates and add HTTP service set docs(templates): reorganize Rust templates and add HTTP handler set Apr 29, 2026
- Move examples/http-hello-world to templates/http-hello-world
- Move examples/key-value to templates/http-kv-service (rename package
  and WIT world for parity with TypeScript naming)
- Add templates/http-client (outgoing HTTP via wstd::http::Client)
- Add templates/http-service (axum routing via wstd-axum)
- Add templates/http-blobstore-service (blob storage backed by wasi:blobstore)
- Update templates/README.md and root README to reference new paths

Brings Rust template coverage to parity with the TypeScript template set
(http-hello-world, http-client, http-service, http-kv-service,
http-blobstore-service).

Signed-off-by: Eric Gregory <eric@cosmonic.com>
Removes the http-blobstore-service template introduced in the prior
commit. The template code follows the canonical wasi:blobstore pattern
and exposes a working CRUD surface, but every PUT against wash dev's
in-process blobstore plugin fails with StreamError::Closed. The host
closes the output stream before the guest can write into it.

This is a known runtime issue that has a fix pending upstream
(see fix/blobby-finish-upload-stream). Re-add the template once that
fix lands so users get a template that works against stock wash dev.

Signed-off-by: Eric Gregory <eric@cosmonic.com>
Rewrite the four Rust template READMEs to match the structure and
linking conventions established in templates in the wasmCloud/typescript
repository: title format, reference-style links throughout (including
all prerequisites), Local development section with wash new + cd + dev
loop, endpoints table, build section, and WIT interfaces section.

Signed-off-by: Eric Gregory <eric@cosmonic.com>
The selective with: { types, consumer } form fails to build with current
wit-bindgen versions, which require every interface in the world (including
the exported handler) to be enumerated. generate_all is equivalent and
keeps the binding generation working as wit-bindgen evolves.

Signed-off-by: Eric Gregory <eric@cosmonic.com>
The "service" suffix collides with wasmCloud's defined notion of a
service: a long-running, stateful Wasm binary that acts as localhost
within a workload boundary. The HTTP-component templates affected here
are stateless components, not services. Rename to "handler" to better
reflect their relationship to wasi:http/incoming-handler:

- templates/http-service       -> templates/http-handler
- templates/http-kv-service    -> templates/http-kv-handler

Updates Cargo package names, .wash/config.yaml component_path entries,
WIT package and world names, READMEs, and the templates/README.md
table accordingly. Both templates rebuilt and exercised end-to-end
under wash dev.

The service-tcp template keeps its name; it is an actual wasmCloud
service.

A follow-up will rename the corresponding TypeScript templates in
wasmCloud/typescript and update the docs that reference them.

Signed-off-by: Eric Gregory <eric@cosmonic.com>
@ericgregory ericgregory force-pushed the reorg/rust-templates branch from 3c60716 to f41120f Compare April 30, 2026 13:32
@ricochet ricochet merged commit 9ebfeb9 into wasmCloud:main Apr 30, 2026
1 check passed
ricochet pushed a commit to wasmCloud/wasmcloud.com that referenced this pull request May 4, 2026
Brings the Rust language support docs up to parity with TypeScript:

- New interface walkthroughs under language-support/rust/:
  - key-value-storage.mdx: wasi:keyvalue via wit-bindgen, with the
    hybrid wstd + wit-bindgen pattern documented
  - messaging.mdx: wasmcloud:messaging across two components, mirroring
    the http-api-with-distributed-workloads template
  - filesystem.mdx: wasi:filesystem with preopens, using the wstd-bundled
    bindings and a wstd-axum file-server example
  - configuration.mdx: wasi:cli/environment for ConfigMaps, Secrets,
    and inline values
- rust/index.mdx: new "Async runtime: when to use wstd vs tokio"
  section with a decision rule, WIT-import diff showing why tokio's
  runtime should not own an HTTP-export component, and notes on the
  passive-utility pattern for tokio sync primitives. Updates the
  transitional-library callout to reflect tokio 1.51's wasip2 socket
  support, and adds a wstd-axum routing subsection.
- sidebars.js: render the four new Rust pages in a Rust Language
  Guide category mirroring TypeScript.
- Update docs that reference the old examples/http-hello-world path
  (now templates/http-hello-world after the wasmCloud reorg in
  wasmCloud/wasmCloud#5084): quickstart, wash index, developer guide,
  installation, kubernetes-operator index, examples, overview/workloads.

Signed-off-by: Eric Gregory <eric@cosmonic.com>
ricochet pushed a commit to wasmCloud/wasmcloud.com that referenced this pull request May 4, 2026
Tracks the template renames in wasmCloud/wasmCloud#5084: http-service
becomes http-handler and http-kv-service becomes http-kv-handler. The
"service" suffix collided with wasmCloud's defined notion of a service
(a long-running, stateful Wasm binary), and these are stateless
HTTP-handler components. "handler" matches the WIT export name
(wasi:http/incoming-handler).

Updates the Rust index.mdx routing example link and every reference in
key-value-storage.mdx (template path, world name, package name, and
the template URL).

TypeScript template renames and TS doc updates are tracked as a
follow-up in wasmCloud/typescript.

Signed-off-by: Eric Gregory <eric@cosmonic.com>
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.

2 participants