rune::interpreter

Struct Interpreter

Source
struct Interpreter<'brw, 'rt> {
    vars: &'brw mut Rt<Vec<Slot<&'rt Cons>>>,
    env: &'brw mut Rt<Env<'rt>>,
}

Fields§

§vars: &'brw mut Rt<Vec<Slot<&'rt Cons>>>§env: &'brw mut Rt<Env<'rt>>

Implementations§

Source§

impl Interpreter<'_, '_>

Source

fn eval_form<'ob>( &mut self, rt: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

pub(crate) fn eval_sexp<'ob>( &mut self, cons: &Rt<Slot<Gc<&Cons>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn catch<'ob>( &mut self, obj: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn throw<'ob>( &mut self, obj: Gc<ObjectType<'_>>, cx: &'ob Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn defvar<'ob>( &mut self, obj: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn eval_call<'ob>( &mut self, sym: &Rt<Slot<Symbol<'_>>>, args: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn eval_function<'ob>( &mut self, obj: &Rt<Slot<Gc<ObjectType<'ob>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn replace_doc_symbol<'ob>( &mut self, quoted: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Handle special case of (:documentation form) to build the docstring dynamically. If the docstring is not of this form, just return the current body.

Source

fn eval_progx<'ob>( &mut self, obj: &Rt<Slot<Gc<ObjectType<'_>>>>, prog_num: u16, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn eval_progn<'ob>( &mut self, obj: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn eval_while<'ob>( &mut self, obj: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn eval_cond<'ob>( &mut self, obj: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn eval_and<'ob>( &mut self, obj: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn eval_or<'ob>( &mut self, obj: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn eval_if<'ob>( &mut self, obj: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn setq<'ob>( &mut self, obj: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn pairs<'ob>( iter: &mut ElemStreamIter<'_>, cx: &'ob Context<'_>, ) -> AnyResult<Option<(Gc<ObjectType<'ob>>, Option<Gc<ObjectType<'ob>>>)>>

Source

fn var_ref<'ob>( &self, sym: Symbol<'_>, cx: &'ob Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn var_set( &mut self, name: Symbol<'_>, new_value: Gc<ObjectType<'_>>, cx: &Context<'_>, ) -> AnyResult<()>

Source

fn quote<'ob>( &self, value: Gc<ObjectType<'ob>>, cx: &Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn eval_let<'ob>( &mut self, form: &Rt<Slot<Gc<ObjectType<'_>>>>, parallel: bool, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn let_bind_serial( &mut self, form: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &mut Context<'_>, ) -> Result<u16, EvalError>

Source

fn let_bind_parallel( &mut self, form: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &mut Context<'_>, ) -> Result<u16, EvalError>

Source

fn create_let_binding( &mut self, var: Symbol<'_>, val: Gc<ObjectType<'_>>, cx: &Context<'_>, ) -> u16

Source

fn let_bind_value<'ob>( &mut self, cons: &Rt<Slot<Gc<&Cons>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn implicit_progn<'ob>( &mut self, forms: ElemStreamIter<'_>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn unwind_protect<'ob>( &mut self, obj: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn save_excursion<'ob>( &mut self, form: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn save_current_buffer<'ob>( &mut self, form: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Source

fn condition_case<'ob>( &mut self, form: &Rt<Slot<Gc<ObjectType<'_>>>>, cx: &'ob mut Context<'_>, ) -> Result<Gc<ObjectType<'ob>>, EvalError>

Auto Trait Implementations§

§

impl<'brw, 'rt> Freeze for Interpreter<'brw, 'rt>

§

impl<'brw, 'rt> !RefUnwindSafe for Interpreter<'brw, 'rt>

§

impl<'brw, 'rt> !Send for Interpreter<'brw, 'rt>

§

impl<'brw, 'rt> !Sync for Interpreter<'brw, 'rt>

§

impl<'brw, 'rt> Unpin for Interpreter<'brw, 'rt>

§

impl<'brw, 'rt> !UnwindSafe for Interpreter<'brw, 'rt>

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, 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.