pub struct Aether { /* private fields */ }Expand description
Main Aether engine struct
Implementations§
Source§impl Aether
impl Aether
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new Aether engine instance
For DSL embedding: IO operations are disabled by default for security.
Use with_permissions() or with_all_permissions() to enable IO.
For CLI usage: The command-line tool uses with_all_permissions() by default.
Sourcepub fn with_permissions(permissions: IOPermissions) -> Self
pub fn with_permissions(permissions: IOPermissions) -> Self
Create a new Aether engine with custom IO permissions
Sourcepub fn with_all_permissions() -> Self
pub fn with_all_permissions() -> Self
Create a new Aether engine with all IO permissions enabled
Sourcepub fn with_stdlib() -> Result<Self, String>
pub fn with_stdlib() -> Result<Self, String>
Create a new Aether engine with standard library preloaded
This creates an engine with all permissions and automatically loads all standard library modules (string_utils, array_utils, validation, datetime, testing).
Sourcepub fn load_stdlib_module(&mut self, module_name: &str) -> Result<(), String>
pub fn load_stdlib_module(&mut self, module_name: &str) -> Result<(), String>
Load a specific standard library module
Available modules: “string_utils”, “array_utils”, “validation”, “datetime”, “testing”
Sourcepub fn load_all_stdlib(&mut self) -> Result<(), String>
pub fn load_all_stdlib(&mut self) -> Result<(), String>
Load all standard library modules
Sourcepub fn with_stdlib_string_utils(self) -> Result<Self, String>
pub fn with_stdlib_string_utils(self) -> Result<Self, String>
Load string utilities module (chainable)
Sourcepub fn with_stdlib_array_utils(self) -> Result<Self, String>
pub fn with_stdlib_array_utils(self) -> Result<Self, String>
Load array utilities module (chainable)
Sourcepub fn with_stdlib_validation(self) -> Result<Self, String>
pub fn with_stdlib_validation(self) -> Result<Self, String>
Load validation module (chainable)
Sourcepub fn with_stdlib_datetime(self) -> Result<Self, String>
pub fn with_stdlib_datetime(self) -> Result<Self, String>
Load datetime module (chainable)
Sourcepub fn with_stdlib_testing(self) -> Result<Self, String>
pub fn with_stdlib_testing(self) -> Result<Self, String>
Load testing framework module (chainable)
Sourcepub fn with_stdlib_set(self) -> Result<Self, String>
pub fn with_stdlib_set(self) -> Result<Self, String>
Load set data structure module (chainable)
Sourcepub fn with_stdlib_queue(self) -> Result<Self, String>
pub fn with_stdlib_queue(self) -> Result<Self, String>
Load queue data structure module (chainable)
Sourcepub fn with_stdlib_stack(self) -> Result<Self, String>
pub fn with_stdlib_stack(self) -> Result<Self, String>
Load stack data structure module (chainable)
Sourcepub fn with_stdlib_heap(self) -> Result<Self, String>
pub fn with_stdlib_heap(self) -> Result<Self, String>
Load heap data structure module (chainable)
Sourcepub fn with_stdlib_sorting(self) -> Result<Self, String>
pub fn with_stdlib_sorting(self) -> Result<Self, String>
Load sorting algorithms module (chainable)
Sourcepub fn with_stdlib_json(self) -> Result<Self, String>
pub fn with_stdlib_json(self) -> Result<Self, String>
Load JSON processing module (chainable)
Sourcepub fn with_stdlib_csv(self) -> Result<Self, String>
pub fn with_stdlib_csv(self) -> Result<Self, String>
Load CSV processing module (chainable)
Sourcepub fn with_stdlib_functional(self) -> Result<Self, String>
pub fn with_stdlib_functional(self) -> Result<Self, String>
Load functional programming utilities module (chainable)
Sourcepub fn with_stdlib_cli_utils(self) -> Result<Self, String>
pub fn with_stdlib_cli_utils(self) -> Result<Self, String>
Load CLI utilities module (chainable)
Sourcepub fn with_stdlib_text_template(self) -> Result<Self, String>
pub fn with_stdlib_text_template(self) -> Result<Self, String>
Load text template engine module (chainable)
Sourcepub fn with_stdlib_regex_utils(self) -> Result<Self, String>
pub fn with_stdlib_regex_utils(self) -> Result<Self, String>
Load regex utilities module (chainable)
Sourcepub fn eval(&mut self, code: &str) -> Result<Value, String>
pub fn eval(&mut self, code: &str) -> Result<Value, String>
Evaluate Aether code and return the result
Sourcepub fn take_trace(&mut self) -> Vec<String>
pub fn take_trace(&mut self) -> Vec<String>
Drain the in-memory TRACE buffer.
This is designed for DSL-safe debugging: scripts call TRACE(...) to record
values, and the host application reads them out-of-band via this method.
Sourcepub fn clear_trace(&mut self)
pub fn clear_trace(&mut self)
Clear the TRACE buffer without returning it.
Sourcepub fn cache_stats(&self) -> CacheStats
pub fn cache_stats(&self) -> CacheStats
获取缓存统计信息
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
清空缓存
Sourcepub fn set_optimization(
&mut self,
constant_folding: bool,
dead_code: bool,
tail_recursion: bool,
)
pub fn set_optimization( &mut self, constant_folding: bool, dead_code: bool, tail_recursion: bool, )
设置优化选项