pub struct Interpreter<'a> {
pub registry: MethodRegistry<'a>,
pub fs: Box<dyn FileAccess>,
pub env_cap: EnvCap,
pub env_overrides: HashMap<String, String>,
pub options: Options,
pub allow_imports_io: bool,
pub current_root: bool,
/* private fields */
}Fields§
§registry: MethodRegistry<'a>§fs: Box<dyn FileAccess>§env_cap: EnvCap§env_overrides: HashMap<String, String>Environment overrides for tests/dry-run snapshots; take priority over the real env.
options: Options§allow_imports_io: bool–allow-imports-io: grant imported modules the root’s I/O capabilities (D1).
current_root: boolSet by the VFS loader: false while evaluating an imported module.
Implementations§
Source§impl<'a> Interpreter<'a>
impl<'a> Interpreter<'a>
pub fn new(options: Options) -> Self
pub fn provide_module(&mut self, alias: impl Into<String>, value: Value<'a>)
Sourcepub fn eval_module(
&mut self,
module: &Module<'a>,
) -> Result<Value<'a>, Diagnostic>
pub fn eval_module( &mut self, module: &Module<'a>, ) -> Result<Value<'a>, Diagnostic>
A module evaluates to an Object of its exported properties and domain blocks.
pub fn eval_expr( &mut self, env: &Env<'a>, e: &Expr<'a>, ) -> Result<Value<'a>, Diagnostic>
Sourcepub fn call_value(
&mut self,
f: &Value<'a>,
args: &[Value<'a>],
span: Span,
) -> Result<Value<'a>, Diagnostic>
pub fn call_value( &mut self, f: &Value<'a>, args: &[Value<'a>], span: Span, ) -> Result<Value<'a>, Diagnostic>
Calls a Value::Function (def / lambda). Extra arguments are ignored (map passes elem+index, a lambda may declare only elem); too few — E0312.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Interpreter<'a>
impl<'a> !Send for Interpreter<'a>
impl<'a> !Sync for Interpreter<'a>
impl<'a> !UnwindSafe for Interpreter<'a>
impl<'a> Freeze for Interpreter<'a>
impl<'a> Unpin for Interpreter<'a>
impl<'a> UnsafeUnpin for Interpreter<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more