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
//! Beancount WASM Plugin Runtime.
//!
//! This crate provides a plugin system for extending Beancount's functionality.
//! Plugins can be written in any language that compiles to WebAssembly, or as
//! native Rust code for maximum performance.
//!
//! # Architecture
//!
//! The plugin system uses wasmtime as the WASM runtime with `MessagePack`
//! serialization for passing data across the WASM boundary.
//!
//! # Plugin Types
//!
//! - **WASM Plugins**: Sandboxed plugins loaded from `.wasm` files
//! - **Native Plugins**: Built-in plugins implemented in Rust
//!
//! # Built-in Plugins (30)
//!
//! See the [plugin reference](https://rustledger.github.io/docs/reference/plugins) for the full list.
//!
//! # Example
//!
//! ```ignore
//! use rustledger_plugin::{PluginManager, PluginInput, PluginOptions};
//!
//! let mut manager = PluginManager::new();
//! manager.load(Path::new("my_plugin.wasm"))?;
//!
//! let input = PluginInput {
//! directives: vec![],
//! options: PluginOptions::default(),
//! config: None,
//! };
//!
//! let output = manager.execute_all(input)?;
//! ```
// Note: unsafe is needed for wasmtime Module::deserialize (caching compiled modules)
pub use ;
pub use ;
pub use ;
pub use ;