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 for Spin 2 and earlier. Applications that do not require
12/// this backward compatibility should use the [`sqlite3`] module instead.
13pub mod sqlite;
14/// SQLite storage.
15pub mod sqlite3;
16
17/// Large Language Model (Serverless AI) APIs
18pub mod llm;
19
20pub use spin_macro::*;
21
22#[doc(hidden)]
23/// Module containing wit bindgen generated code.
24///
25/// This is only meant for internal consumption.
26pub mod wit {
27    #![allow(missing_docs)]
28
29    wit_bindgen::generate!({
30        world: "platform",
31        path: "./wit",
32        with: {
33            "wasi:io/error@0.2.0": ::wasi::io::error,
34            "wasi:io/streams@0.2.0": ::wasi::io::streams,
35            "wasi:io/poll@0.2.0": ::wasi::io::poll,
36        },
37        generate_all,
38    });
39    pub use fermyon::spin2_0_0 as v2;
40    pub use spin::postgres3_0_0::postgres as pg3;
41    pub use spin::postgres4_0_0::postgres as pg4;
42    pub use spin::sqlite::sqlite as sqlite3;
43}
44
45#[export_name = concat!("spin-sdk-version-", env!("SDK_VERSION"))]
46extern "C" fn __spin_sdk_version() {}
47
48#[cfg(feature = "export-sdk-language")]
49#[export_name = "spin-sdk-language-rust"]
50extern "C" fn __spin_sdk_language() {}
51
52#[export_name = concat!("spin-sdk-commit-", env!("SDK_COMMIT"))]
53extern "C" fn __spin_sdk_hash() {}
54
55pub mod http;
56
57#[allow(missing_docs)]
58pub mod mqtt;
59
60#[allow(missing_docs)]
61pub mod redis;
62
63pub mod pg;
64pub mod pg3;
65pub mod pg4;
66
67pub mod mysql;
68
69pub mod variables;
70
71#[doc(hidden)]
72pub use wit_bindgen;