1#![deny(missing_docs)]
4
5#[cfg(test)]
6mod test;
7
8pub mod key_value;
10
11pub mod sqlite;
13
14pub mod llm;
16
17pub use spin_macro::*;
19
20#[doc(hidden)]
21pub mod wit {
25 #![allow(missing_docs)]
26
27 wit_bindgen::generate!({
28 world: "platform",
29 path: "./wit",
30 with: {
31 "wasi:io/error@0.2.0": spin_executor::bindings::wasi::io::error,
32 "wasi:io/streams@0.2.0": spin_executor::bindings::wasi::io::streams,
33 "wasi:io/poll@0.2.0": spin_executor::bindings::wasi::io::poll,
34 }
35 });
36 pub use fermyon::spin2_0_0 as v2;
37 pub use spin::postgres::postgres as pg3;
38}
39
40#[cfg(target_arch = "wasm32")]
44#[doc(hidden)]
45pub use wit::__link_section;
46
47#[export_name = concat!("spin-sdk-version-", env!("SDK_VERSION"))]
48extern "C" fn __spin_sdk_version() {}
49
50#[cfg(feature = "export-sdk-language")]
51#[export_name = "spin-sdk-language-rust"]
52extern "C" fn __spin_sdk_language() {}
53
54#[export_name = concat!("spin-sdk-commit-", env!("SDK_COMMIT"))]
55extern "C" fn __spin_sdk_hash() {}
56
57pub mod http;
59
60#[allow(missing_docs)]
62pub mod mqtt {
63 pub use super::wit::v2::mqtt::{Connection, Error, Payload, Qos};
64}
65
66#[allow(missing_docs)]
68pub mod redis {
69 use std::hash::{Hash, Hasher};
70
71 pub use super::wit::v2::redis::{Connection, Error, Payload, RedisParameter, RedisResult};
72
73 impl PartialEq for RedisResult {
74 fn eq(&self, other: &Self) -> bool {
75 use RedisResult::*;
76 match (self, other) {
77 (Nil, Nil) => true,
78 (Status(a), Status(b)) => a == b,
79 (Int64(a), Int64(b)) => a == b,
80 (Binary(a), Binary(b)) => a == b,
81 _ => false,
82 }
83 }
84 }
85
86 impl Eq for RedisResult {}
87
88 impl Hash for RedisResult {
89 fn hash<H: Hasher>(&self, state: &mut H) {
90 use RedisResult::*;
91
92 match self {
93 Nil => (),
94 Status(s) => s.hash(state),
95 Int64(v) => v.hash(state),
96 Binary(v) => v.hash(state),
97 }
98 }
99 }
100}
101
102pub mod pg;
104
105pub mod pg3;
107
108pub mod mysql;
110
111#[doc(inline)]
112pub use wit::v2::variables;
113
114#[doc(hidden)]
115pub use wit_bindgen;