1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//! Alien SDK for Rust.
//!
//! Cloud-agnostic bindings for storage, KV, queues, and vaults, plus the
//! Worker application context.
//! Works on AWS, GCP, Azure, Kubernetes, and locally.
//!
//! This is the public-facing crate for Alien app developers. Its binding API is
//! deliberately limited to [`Bindings`] and the four kinds applications can
//! use directly: [`Storage`], [`Kv`], [`Queue`], and [`Vault`].
//!
//! Platform tooling that needs provider construction or managed resource kinds
//! such as builds and artifact registries uses `alien_bindings` directly.
//! Worker applications enable the `worker` Cargo feature and use the
//! `worker` module for task, event, lifecycle, and `waitUntil` APIs. The
//! feature is not enabled by default, so direct-binding-only applications do
//! not depend on the Worker protocol.
//!
//! # Example
//!
//! ```no_run
//! use alien_sdk::Bindings;
//!
//! #[tokio::main(flavor = "current_thread")]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let bindings = Bindings::from_env()?;
//! let cache = bindings.kv("cache").await?;
//! cache.put("greeting", b"hello".to_vec(), None).await?;
//! assert_eq!(cache.get("greeting").await?, Some(b"hello".to_vec()));
//! Ok(())
//! }
//! ```
//!
//! Provider construction and managed resource bindings are not part of this
//! crate's application API:
//!
//! ```compile_fail
//! use alien_sdk::BindingsProvider;
//! ```
//!
//! ```compile_fail
//! use alien_sdk::BindingsProviderApi;
//! ```
//!
//! ```compile_fail
//! use alien_sdk::Binding;
//! ```
//!
//! ```compile_fail
//! use alien_sdk::{ArtifactRegistry, Build, Container, Postgres, ServiceAccount, Worker};
//! ```
//!
//! ```compile_fail
//! use alien_sdk::provider;
//! ```
//!
//! ```compile_fail
//! use alien_sdk::providers;
//! ```
//!
//! ```compile_fail
//! use alien_sdk::http_client;
//! ```
//!
pub use ;
/// Errors returned by the application binding and Worker APIs.
/// Serializable requests returned by storage presigning operations.
/// App-facing binding value types (the option/message/result types that flow
/// through storage/KV/queue/vault calls).
/// Worker-only task, event, lifecycle, and `waitUntil` APIs.