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
//! Orbis Plugin SDK
//!
//! This module provides a complete, ergonomic SDK for building WASM plugins with minimal boilerplate.
//!
//! # Quick Start
//!
//! ```rust,ignore
//! use orbis_plugin_api::prelude::*;
//!
//! // Define your plugin using the macro
//! orbis_plugin! {
//! name: "my-plugin",
//! version: "1.0.0",
//!
//! // Optional initialization
//! init: || {
//! log::info!("Plugin initialized!");
//! Ok(())
//! },
//!
//! // Optional cleanup
//! cleanup: || {
//! log::info!("Plugin cleaning up!");
//! Ok(())
//! },
//!
//! handlers: {
//! "my_handler" => my_handler,
//! }
//! }
//!
//! fn my_handler(ctx: Context) -> Result<Response> {
//! let count: i64 = state::get("counter")?.unwrap_or(0);
//! state::set("counter", &(count + 1))?;
//!
//! Response::json(&json!({
//! "message": "Hello!",
//! "count": count + 1
//! }))
//! }
//! ```
//!
//! # Features
//!
//! - **Zero boilerplate**: No manual memory management, extern declarations, or FFI
//! - **Type-safe state**: Automatic JSON serialization/deserialization
//! - **Ergonomic logging**: Simple `log::info!()` style macros
//! - **Database access**: Query and execute SQL with typed results
//! - **HTTP client**: Make external API calls
//! - **Event system**: Emit and subscribe to events
//! - **Error handling**: Proper Result types with context
// Re-export everything for convenience
pub use Context;
pub use ;
pub use ;
pub use Response;
/// Prelude module for convenient imports