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
//! Ion — an embeddable scripting language for Rust.
//!
//! Ion is a small, strongly-typed scripting language inspired by Starlark,
//! designed for embedding in Rust applications. It features a tree-walk
//! interpreter and an optional bytecode VM for better performance.
//!
//! # Quick Start
//!
//! ```rust
//! use ion_core::engine::Engine;
//!
//! let mut engine = Engine::new();
//! let result = engine.eval("1 + 2").unwrap();
//! assert_eq!(result, ion_core::value::Value::Int(3));
//! ```
//!
//! # Features
//!
//! - **`vm`** (default) — Bytecode compiler and stack-based VM
//! - **`optimize`** (default) — Peephole optimizer, constant folding,
//! dead-code elimination, tail-call optimization
//! - **`derive`** (default) — `#[derive(IonType)]` for host type injection
//! - **`concurrency`** — Structured concurrency: `async`/`spawn`/`.await`/
//! `select`/`channel`, cooperative cancellation, tokio-friendly
//! embedding via [`engine::Engine::register_closure`]
//! - **`msgpack`** — `Value::to_msgpack()` / `from_msgpack()` via `rmpv`
//! - **`obfuscate`** — String obfuscation via `obfstr`
//! - **`rewrite`** — Source rewriter at [`rewrite::replace_global`]
/// Macro for string obfuscation. Returns a `String`.
/// When the `obfuscate` feature is enabled, strings are encrypted at compile
/// time and decrypted at runtime via `obfstr`. Without the feature, they
/// pass through as regular `String`s.
/// Same as `ion_str!` but returns `&str` (non-obfuscated in obfuscate mode
/// for contexts requiring `&'static str` like type_name()).
/// These strings are short type names that are low-value for obfuscation.
pub use Engine;
pub use Value;
pub use IonType;