pub struct ExecCtx<R: Rt, E: UserEvent> {
pub env: Env<R, E>,
pub cached: FxHashMap<BindId, Value>,
pub rt: R,
/* private fields */
}
Fields§
§env: Env<R, E>
§cached: FxHashMap<BindId, Value>
§rt: R
Implementations§
Source§impl<R: Rt, E: UserEvent> ExecCtx<R, E>
impl<R: Rt, E: UserEvent> ExecCtx<R, E>
pub fn clear(&mut self)
Sourcepub fn new(user: R) -> Self
pub fn new(user: R) -> Self
Build a new execution context.
This is a very low level interface that you can use to build a custom runtime with deep integration to your code. It is very difficult to use, and if you don’t implement everything correctly the semantics of the language can be wrong.
Most likely you want to use the rt
module instead.
pub fn register_builtin<T: BuiltIn<R, E>>(&mut self) -> Result<()>
Sourcepub fn set_var(&mut self, id: BindId, v: Value)
pub fn set_var(&mut self, id: BindId, v: Value)
Built in functions should call this when variables are set unless they are sure the variable does not need to be cached. This will also call the user ctx set_var.
pub fn set_var_now(&mut self, id: BindId, v: Value)
Sourcepub fn with_restored<T, F: FnOnce(&mut Self) -> T>(
&mut self,
env: Env<R, E>,
f: F,
) -> T
pub fn with_restored<T, F: FnOnce(&mut Self) -> T>( &mut self, env: Env<R, E>, f: F, ) -> T
Restore the lexical environment to the snapshot env
for the
duration of f
restoring it to it’s original value
afterwords. by_id
and lambdas
defined by the closure will
be retained.
Auto Trait Implementations§
impl<R, E> Freeze for ExecCtx<R, E>where
R: Freeze,
impl<R, E> !RefUnwindSafe for ExecCtx<R, E>
impl<R, E> Send for ExecCtx<R, E>where
R: Send,
impl<R, E> Sync for ExecCtx<R, E>where
R: Sync,
impl<R, E> Unpin for ExecCtx<R, E>where
R: Unpin,
impl<R, E> !UnwindSafe for ExecCtx<R, E>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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