Expand description
The Rust Spin SDK.
This crate is the main entry point for building Spin
components in Rust. Each capability is exposed as a feature-gated
module. All features are enabled by default; disable default-features
and pick only what you need to slim down compile times.
The http_service and redis_subscriber attribute macros
generate the boilerplate required to expose a component to the
Spin runtime.
Re-exports§
pub use wasip3;pub use wasip3::wit_bindgen;
Modules§
- http
http - Incoming and outgoing HTTP requests.
- key_
value key-value - Persistent key-value storage. Spin key-value persistent storage.
- llm
llm - Large-language-model inference.
- mqtt
mqtt - MQTT message publishing. MQTT message publishing.
- mysql
mysql - MySQL database access. MySQL relational database storage.
- pg
pg - PostgreSQL database access. Postgres relational database storage.
- redis
redis - Redis storage and pub/sub. Redis storage and message publishing.
- sqlite
sqlite - SQLite database access.
- time
- Time-related functions.
- variables
variables - Application variable lookup.
Component variables must be defined in the application
manifest, in the
[component.<name>.variables]section. Component variables typically use template syntax to derive values from application variables, which are the only variables that may be overridden directly (for example, on the Spin command line).
Macros§
- dependencies
- Re-export entrypoint macros
This macro generates code from a Spin components dependencies using wit-bindgen. During expansion the
macro will check for existence of a
spin-dependencies.witin the developers project directory and if it is present (used to indicate the presence of dependencies in the manifest) will invoke wit-bindgen to generate the bindings.
Attribute Macros§
- http_
service - Re-export entrypoint macros
Marks an
async fnas an HTTP component entrypoint for Spin. - redis_
subscriber - Re-export entrypoint macros The entrypoint to a Spin Redis component.