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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! Compile and run Rex programs from a Rust host.
//!
//! This module is the main embedding API. A host creates an
//! [`Engine`](crate::engine::Engine), injects Rex modules or Rust-backed
//! [`Module`](crate::engine::Module) exports, compiles user source into a
//! [`CompiledProgram`](crate::engine::CompiledProgram), and runs it with an
//! [`Evaluator`](crate::engine::Evaluator). Convenience methods such as
//! [`eval_snippet`](crate::engine::Evaluator::eval_snippet) combine
//! compilation and execution for the common single-shot case.
//!
//! The public types here are re-exported from the engine crate so applications
//! can depend on `rex` as their primary embedding crate.
/// Hook used by [`AsyncCallPolicy`] to decide where admitted async host calls run.
pub use AsyncCallExecutor;
/// Runtime policy for polling or dispatching async host-call futures.
pub use AsyncCallPolicy;
/// Runtime-side implementation metadata for a type class method.
pub use ClassMethodCapability;
/// A type class method required by a compiled program at runtime.
pub use ClassMethodRequirement;
/// Error from the compile phase of the Rex pipeline.
pub use CompileError;
/// Summary of external native and type class bindings referenced by compiled code.
pub use CompiledExterns;
/// A prepared Rex program that can be validated and evaluated once.
pub use CompiledProgram;
/// Metadata describing what a [`CompiledProgram`] captures and whether it is serializable.
pub use CompiledProgramBoundary;
/// Compile-time view of an [`Engine`] used to prepare Rex source for execution.
pub use Compiler;
/// Host-call context passed to dynamic native functions.
pub use Context;
/// Configurable Rex engine for host modules, type information, and runtime policy.
pub use Engine;
/// Common error type used by the parser, type system bridge, module loader, and evaluator.
pub use EngineError;
/// Options used when constructing an [`Engine`].
pub use EngineOptions;
/// Error from the evaluation phase after code has compiled.
pub use EvalError;
/// Single-shot runtime used to validate and run a compiled Rex program.
pub use Evaluator;
/// Admission limits for evaluator work and pending async host calls.
pub use ExecutionBounds;
/// Error returned by APIs that perform both compilation and evaluation.
pub use ExecutionError;
/// A staged Rust-backed function export before it is injected into an [`Engine`].
pub use Export;
/// Convert a Rex runtime value into a Rust value.
pub use FromRex;
/// A garbage-collected handle to a Rex runtime value.
pub use Handle;
/// Allocation arena and ownership root for Rex runtime values.
pub use Heap;
/// Trait implemented by typed asynchronous Rust functions that can be exported to Rex.
pub use HostFnAsync;
/// Trait implemented by typed synchronous Rust functions that can be exported to Rex.
pub use HostFnSync;
/// Convert a Rust value into a Rex runtime value.
pub use IntoRex;
/// Staged host module containing Rex declarations and Rust-backed exports.
pub use Module;
/// Runtime-side metadata for one native function implementation.
pub use NativeCapability;
/// Boxed future returned by handle-based async native functions.
pub use NativeFuture;
/// Native function signature required by a compiled program at runtime.
pub use NativeRequirement;
/// Name of the automatically injected Rex prelude module.
pub use PRELUDE_MODULE_NAME;
/// Controls whether the Rex prelude is installed when constructing an [`Engine`].
pub use PreludeMode;
/// Internal module name used for declarations injected into the root environment.
pub use ROOT_MODULE_NAME;
/// Request passed to a custom module resolver.
pub use ResolveRequest;
/// Module payload returned by a resolver.
pub use ResolvedModule;
/// Source or pre-parsed AST content returned by a resolver.
pub use ResolvedModuleContent;
/// Trait for producing a Rex default value for a Rust-facing type.
pub use RexDefault;
/// Runtime capabilities available to satisfy a compiled program's link contract.
pub use RuntimeCapabilities;
/// Compatibility report between compiled requirements and runtime capabilities.
pub use RuntimeCompatibility;
/// Preflight view of runtime linkage available to an evaluator.
pub use RuntimeEnv;
/// Metadata describing what a [`RuntimeEnv`] captures and whether it is serializable.
pub use RuntimeEnvBoundary;
/// Runtime ABI and callable requirements captured by a [`CompiledProgram`].
pub use RuntimeLinkContract;
/// Raw Rex runtime value stored in the heap.
pub use Value;
/// Formatting options for displaying Rex runtime values.
pub use ValueDisplayOptions;
/// Convert ADT collection errors into an embedder-facing [`EngineError`].
pub use collect_adts_error_to_engine;
/// Build the internal symbol used for a virtual module export.
pub use virtual_export_name;