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. Spin key-value persistent storage.
llmllm
Large-language-model inference.
mqttmqtt
MQTT message publishing. MQTT message publishing.
mysqlmysql
MySQL database access. MySQL relational database storage.
pgpg
PostgreSQL database access. Postgres relational database storage.
redisredis
Redis storage and pub/sub. Redis storage and message publishing.
sqlitesqlite
SQLite database access.
time
Time-related functions.
variablesvariables
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.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
Re-export entrypoint macros Marks an async fn as an HTTP component entrypoint for Spin.
redis_subscriber
Re-export entrypoint macros The entrypoint to a Spin Redis component.