spin_sdk/
lib.rs

1//! The Rust Spin SDK.
2
3#![deny(missing_docs)]
4
5#[cfg(test)]
6mod test;
7
8/// Key/Value storage.
9pub mod key_value;
10
11/// SQLite storage.
12pub mod sqlite;
13
14/// Large Language Model (Serverless AI) APIs
15pub mod llm;
16
17pub use spin_macro::*;
18
19#[doc(hidden)]
20/// Module containing wit bindgen generated code.
21///
22/// This is only meant for internal consumption.
23pub mod wit {
24    #![allow(missing_docs)]
25
26    wit_bindgen::generate!({
27        world: "platform",
28        path: "./wit",
29        with: {
30            "wasi:io/error@0.2.0": ::wasi::io::error,
31            "wasi:io/streams@0.2.0": ::wasi::io::streams,
32            "wasi:io/poll@0.2.0": ::wasi::io::poll,
33        }
34    });
35    pub use fermyon::spin2_0_0 as v2;
36    pub use spin::postgres::postgres as pg3;
37}
38
39/// Needed by the export macro
40///
41/// See [this commit](https://github.com/bytecodealliance/wit-bindgen/pull/394/commits/9d2ea88f986f4a883ba243449e3a070cac18958e) for more info.
42#[cfg(target_arch = "wasm32")]
43#[doc(hidden)]
44pub use wit::__link_section;
45
46#[export_name = concat!("spin-sdk-version-", env!("SDK_VERSION"))]
47extern "C" fn __spin_sdk_version() {}
48
49#[cfg(feature = "export-sdk-language")]
50#[export_name = "spin-sdk-language-rust"]
51extern "C" fn __spin_sdk_language() {}
52
53#[export_name = concat!("spin-sdk-commit-", env!("SDK_COMMIT"))]
54extern "C" fn __spin_sdk_hash() {}
55
56pub mod http;
57
58#[allow(missing_docs)]
59pub mod mqtt;
60
61#[allow(missing_docs)]
62pub mod redis;
63
64pub mod pg;
65
66pub mod pg3;
67
68pub mod mysql;
69
70pub mod variables;
71
72#[doc(hidden)]
73pub use wit_bindgen;