Aether

Struct Aether 

Source
pub struct Aether { /* private fields */ }
Expand description

Main Aether engine struct

Implementations§

Source§

impl Aether

Source

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.

Source

pub fn with_permissions(permissions: IOPermissions) -> Self

Create a new Aether engine with custom IO permissions

Source

pub fn with_all_permissions() -> Self

Create a new Aether engine with all IO permissions enabled

Source

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).

Source

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”

Source

pub fn load_all_stdlib(&mut self) -> Result<(), String>

Load all standard library modules

Source

pub fn with_stdlib_string_utils(self) -> Result<Self, String>

Load string utilities module (chainable)

Source

pub fn with_stdlib_array_utils(self) -> Result<Self, String>

Load array utilities module (chainable)

Source

pub fn with_stdlib_validation(self) -> Result<Self, String>

Load validation module (chainable)

Source

pub fn with_stdlib_datetime(self) -> Result<Self, String>

Load datetime module (chainable)

Source

pub fn with_stdlib_testing(self) -> Result<Self, String>

Load testing framework module (chainable)

Source

pub fn with_stdlib_set(self) -> Result<Self, String>

Load set data structure module (chainable)

Source

pub fn with_stdlib_queue(self) -> Result<Self, String>

Load queue data structure module (chainable)

Source

pub fn with_stdlib_stack(self) -> Result<Self, String>

Load stack data structure module (chainable)

Source

pub fn with_stdlib_heap(self) -> Result<Self, String>

Load heap data structure module (chainable)

Source

pub fn with_stdlib_sorting(self) -> Result<Self, String>

Load sorting algorithms module (chainable)

Source

pub fn with_stdlib_json(self) -> Result<Self, String>

Load JSON processing module (chainable)

Source

pub fn with_stdlib_csv(self) -> Result<Self, String>

Load CSV processing module (chainable)

Source

pub fn with_stdlib_functional(self) -> Result<Self, String>

Load functional programming utilities module (chainable)

Source

pub fn with_stdlib_cli_utils(self) -> Result<Self, String>

Load CLI utilities module (chainable)

Source

pub fn with_stdlib_text_template(self) -> Result<Self, String>

Load text template engine module (chainable)

Source

pub fn with_stdlib_regex_utils(self) -> Result<Self, String>

Load regex utilities module (chainable)

Source

pub fn eval(&mut self, code: &str) -> Result<Value, String>

Evaluate Aether code and return the result

Source

pub fn cache_stats(&self) -> CacheStats

获取缓存统计信息

Source

pub fn clear_cache(&mut self)

清空缓存

Source

pub fn set_optimization( &mut self, constant_folding: bool, dead_code: bool, tail_recursion: bool, )

设置优化选项

Trait Implementations§

Source§

impl Default for Aether

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Aether

§

impl !RefUnwindSafe for Aether

§

impl !Send for Aether

§

impl !Sync for Aether

§

impl Unpin for Aether

§

impl !UnwindSafe for Aether

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.