137 releases (41 stable)
| 1.3.1 | Oct 18, 2025 |
|---|---|
| 1.3.0-rc8 | Sep 29, 2025 |
| 1.3.0-dev.21 | Jul 30, 2025 |
| 1.2.0 | Mar 28, 2025 |
| 0.0.16 | Mar 30, 2024 |
#82 in WebAssembly
Used in 11 crates
1MB
23K
SLoC
golem-wasm-rpc
Defines data types for Golem's remote function invocation and conversions between them.
WitValueis the WIT-defined generic data type capable of representing an arbitrary value, generated bywit-bindgen- A builder and an extractor API for
WitValue Valueis a recursive Rust type which is more convenient to work with thanWitValue. Conversion betweenWitValueandValueis implemented in both directions.- Protobuf message types for describing values and types, and a protobuf version of
WitValueitself and conversion from and toValueandWitValue - JSON representation of WIT values, as defined in the Golem docs.
- Conversion of
Valueto and fromwasmtimevalues
The JSON representation requires additional type information which can be extracted using the golem-wasm-ast crate.
Host and stub mode
The golem-wasm-rpc crate can be both used in host and guest environments:
To compile the host version:
cargo build -p golem-wasm-rpc --no-default-features --features host
To compile the guest version, has minimal dependencies and feature set to be used in generated stubs:
cargo component build -p golem-wasm-rpc --no-default-features --features stub
Feature flags
arbitraryadds anArbitraryinstance forValuebincodeadds Bincode codecs for some typeshost-bindingsenables WIT-generated types for wasmtime hostsjsonadds conversion functions for mapping of a WIT value and type definition to/from JSONpoem_openapiadds poem OpenAPI type class instances for some of the typesprotobufadds the protobuf message typesserdeadds serde JSON serialization for some of the typestextenableswasm-wavebased text representation for valueswasmtimeadds conversion towasmtimeValvalueshostenables all features:arbitrary,bincode,host-bindings,json,poem_openapi,protobuf,serde,text,typeinfo, andwasmtimestubis to be used in generated WASM stubs and disables all features, and generates guest bindings instead of host bindings
Dependencies
~4–31MB
~410K SLoC