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
116
117
118
119
120
121
122
123
124
125
126
127
//! # Sololc Webhook SDK
//!
//! Provides a high-performance, modern, and ergonomic WASI-HTTP Webhook SDK
//! optimized for the Sololc Runtime.
//!
//! This crate simplifies the development of Webhook microservices by abstracting
//! raw WebAssembly System Interface (WASI) HTTP components into a routing style
//! reminiscent of mainstream Rust web frameworks (such as Axum or Actix-web).
generate!;
/// Represents the primary entrypoint contract exported to the host gateway.
///
/// Under the hood, this handles the low-level WASIp2 `wasi:http/incoming-handler`
/// interface. It is driven asynchronously by the host executor.
///
/// See also [`wasi::http::types`] for the underlying raw assets.
pub use Guest;
/// Exposes the official WASI-HTTP types used for lower-level requests and responses.
///
/// Contains critical raw assets such as [`IncomingRequest`], [`OutgoingResponse`],
/// [`ResponseOutparam`], and [`Fields`]. For a more ergonomic experience, use the SDK's
/// high-level wrapper types [`Request`] and [`Response`] instead.
pub use ;
/// Exposes the ergonomic high-level wrapper types.
///
/// Re-exports [`Request`] and [`Response`] which abstract raw incoming streams and
/// field structures into standard, intuitive web structures.
pub use ;
/// Routes an incoming HTTP `GET` request to the annotated handler function.
///
/// Acts as the entrypoint for retrieving read-only resources within your plugin.
///
/// # Examples
///
/// ```rust
/// use sololc_webhook_sdk::{get, Request, Response};
///
/// #[get("/api/v1/auth")]
/// async fn check_auth(req: Request) -> Response {
/// Response::json(200, r#"{"status": "approved"}"#)
/// }
/// ```
pub use get;
/// Routes an incoming HTTP `POST` request to the annotated handler function.
///
/// Handles data creation, event synchronizations, or heavy payloads sent by Webhook triggers.
///
/// # Examples
///
/// ```rust
/// use sololc_webhook_sdk::{post, Request, Response};
///
/// #[post("/api/v1/telemetry")]
/// async fn record_metrics(req: Request) -> Response {
/// Response::json(201, r#"{"status": "recorded"}"#)
/// }
/// ```
pub use post;
/// Routes an incoming HTTP `PUT` request to the annotated handler function.
///
/// Replaces or updates an existing entity completely with the provided payload.
pub use put;
/// Routes an incoming HTTP `DELETE` request to the annotated handler function.
///
/// Removes or revokes resources associated with the matching routing path.
pub use delete;
/// Routes an incoming HTTP `PATCH` request to the annotated handler function.
///
/// Applies partial modifications or fractional updates to a specific resource.
pub use patch;
/// Routes an incoming HTTP `HEAD` request to the annotated handler function.
///
/// Retrieves only the headers of a resource, identical to a `GET` request but without the response body.
pub use head;
/// Routes an incoming HTTP `OPTIONS` request to the annotated handler function.
///
/// Describes the communication options and allowed methods for the target resource.
pub use options;
// --- 1. Logging client module ---
/// Initializes the global WASIp2 system logger and binds it to the `log` ecosystem.
///
/// Returns a [`Result<(), log::SetLoggerError>`][log::SetLoggerError] indicating
/// whether the active global logger was bound successfully.
pub use init as init_logger;
// --- 2. Key-value storage module ---
/// Represents a safe, high-level abstraction over the WASIp2 `wasi:keyvalue` system.
///
/// Leverages the state-bound APIs provided by the Sololc host executor to persist
/// and fetch arbitrary byte-buffers synchronously within standard asynchronous routines.
pub use KvStore;
// --- 3. Asynchronous HTTP client module ---
/// Dispatches outgoing HTTP requests utilizing the WASIp2 `wasi:http/outgoing-handler`.
///
/// Coordinates connection pools and underlying network transports securely via the sandbox gateway.
pub use crateHttpClient;