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
//! Serverless Function Library
//!
//! A Rust library that simplifies the development and invocation of serverless functions.
//! Allows calling serverless functions as if they were ordinary functions,
//! with deployment strategy determined by crate feature flags.
//!
//! # Features
//!
//! - **Simplified Interface**: Same syntax as regular function calls
//! - **Smart Deployment**: Automatic deployment strategy based on feature flags
//! - **Local Debugging**: Test without actual deployment
//! - **Type Safety**: Compile-time type checking for parameters and return values
//!
//! # Example
//!
//! ```rust,no_run
//! use serverless_fn::{serverless, ServerlessError};
//! use serde::{Serialize, Deserialize};
//!
//! #[derive(Serialize, Deserialize, Debug)]
//! pub struct Post {
//! pub id: u64,
//! pub title: String,
//! pub content: String,
//! }
//!
//! #[serverless]
//! pub async fn read_posts(how_many: usize, query: String) -> Result<Vec<Post>, ServerlessError> {
//! Ok((0..how_many)
//! .map(|i| Post {
//! id: i as u64,
//! title: format!("Post {}", i),
//! content: format!("Content of post {}", i),
//! })
//! .collect())
//! }
//! ```
//!
//! # Feature Flags
//!
//! - `remote_call`: Enable remote invocation mode (default)
//! - `local_call`: Enable local function call mode
//! - `json_serialization`: Use JSON serialization (default)
//! - `postcard_serialization`: Use Postcard serialization
//! - `mock_server`: Enable mock server for testing
//! - `telemetry`: Enable telemetry and monitoring
// Re-export macros
pub use serverless;
// Re-export commonly used types
pub use ServerlessError;
pub use FunctionServer;
// Re-export server components
pub use ;
pub use HttpTransport;
// Re-export config types
pub use ;