Skip to main content

Interpreter

Struct Interpreter 

Source
pub struct Interpreter {
    pub env: Env,
    /* private fields */
}

Fields§

§env: Env

Implementations§

Source§

impl Interpreter

Source

pub fn callable_declared_effects(fn_val: &Value) -> Vec<String>

Source

pub fn call_value_pub( &mut self, fn_val: Value, args: Vec<Value>, ) -> Result<Value, RuntimeError>

Source

pub fn call_value_with_effects_pub( &mut self, fn_val: Value, args: Vec<Value>, entry_name: &str, allowed_effects: Vec<String>, ) -> Result<Value, RuntimeError>

Source§

impl Interpreter

Source

pub fn new() -> Self

Source

pub fn execution_mode(&self) -> ExecutionMode

Source

pub fn set_execution_mode_normal(&mut self)

Source

pub fn start_recording(&mut self)

Source

pub fn start_replay(&mut self, effects: Vec<EffectRecord>, validate_args: bool)

Source

pub fn take_recorded_effects(&mut self) -> Vec<EffectRecord>

Source

pub fn replay_progress(&self) -> (usize, usize)

Source

pub fn ensure_replay_consumed(&self) -> Result<(), RuntimeError>

Source

pub fn configure_recording_sink( &mut self, path: PathBuf, request_id: String, timestamp: String, program_file: String, module_root: String, entry_fn: String, input: JsonValue, )

Source

pub fn recording_sink_path(&self) -> Option<PathBuf>

Source

pub fn persist_recording_snapshot( &self, output: RecordedOutcome, ) -> Result<(), RuntimeError>

Source

pub fn enable_memo(&mut self, fns: HashSet<String>)

Mark a set of function names as eligible for auto-memoization.

Source

pub fn register_effect_set(&mut self, name: String, effects: Vec<String>)

Register a named effect set alias.

Source

pub fn lookup(&self, name: &str) -> Result<Value, RuntimeError>

Source

pub fn define(&mut self, name: String, val: Value)

Source

pub fn define_module_path( &mut self, path: &str, val: Value, ) -> Result<(), RuntimeError>

Source

pub fn load_module( &mut self, name: &str, base_dir: &str, loading: &mut Vec<String>, loading_set: &mut HashSet<String>, ) -> Result<Value, RuntimeError>

Source§

impl Interpreter

Source

pub fn eval_expr(&mut self, expr: &Expr) -> Result<Value, RuntimeError>

Source§

impl Interpreter

Source

pub fn exec_items(&mut self, items: &[TopLevel]) -> Result<Value, RuntimeError>

Source

pub fn register_type_def(&mut self, td: &TypeDef)

Register a user-defined type: sum type variants and record constructors.

Source

pub fn exec_fn_def(&mut self, fd: &FnDef) -> Result<(), RuntimeError>

Source

pub fn exec_stmt(&mut self, stmt: &Stmt) -> Result<Value, RuntimeError>

Source

pub fn exec_body(&mut self, stmts: &[Stmt]) -> Result<Value, RuntimeError>

Source

pub fn run_file(&mut self, source: &str) -> Result<Value, RuntimeError>

Source§

impl Interpreter

Source

pub fn aver_eq(&self, a: &Value, b: &Value) -> bool

Auto Trait Implementations§

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.