Skip to main content

Crate spin_sdk

Crate spin_sdk 

Source
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§

httphttp
Incoming and outgoing HTTP requests.
key_valuekey-value
Persistent key-value storage.
llmllm
Large-language-model inference.
mqttmqtt
MQTT message publishing.
mysqlmysql
MySQL relational database storage.
pgpg
Postgres relational database storage.
redisredis
Redis storage and message publishing.
sqlitesqlite
SQLite database access.
time
Time-related functions.
variablesvariables
Application variable lookup.

Macros§

dependencies
This macro generates code from a Spin components dependencies using wit-bindgen. During expansion the macro will check for existence of a spin-dependencies.wit in 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
Marks an async fn as an HTTP component entrypoint for Spin.
redis_subscriber
The entrypoint to a Spin Redis component.