pub struct RuntimeContext { /* private fields */ }Expand description
Static run context visible to the virtual machine.
This contains:
- Declared functions.
- Declared instance functions.
- Built-in type checks.
Implementations§
Source§impl RuntimeContext
impl RuntimeContext
Sourcepub fn type_check_for(&self, item: &Item) -> Option<TypeCheck>
pub fn type_check_for(&self, item: &Item) -> Option<TypeCheck>
Use the specified type check.
Sourcepub fn lookup(
&self,
hash: Hash,
) -> Option<&Arc<dyn Fn(&mut Stack, usize) -> Result<(), VmError> + Send + Sync>>
pub fn lookup( &self, hash: Hash, ) -> Option<&Arc<dyn Fn(&mut Stack, usize) -> Result<(), VmError> + Send + Sync>>
Lookup the given native function handler in the context.
Sourcepub fn constant(&self, hash: Hash) -> Option<&ConstValue>
pub fn constant(&self, hash: Hash) -> Option<&ConstValue>
Read a constant value from the unit.
Trait Implementations§
Source§impl Debug for RuntimeContext
impl Debug for RuntimeContext
Source§impl Default for RuntimeContext
impl Default for RuntimeContext
Source§fn default() -> RuntimeContext
fn default() -> RuntimeContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RuntimeContext
impl !RefUnwindSafe for RuntimeContext
impl Send for RuntimeContext
impl Sync for RuntimeContext
impl Unpin for RuntimeContext
impl !UnwindSafe for RuntimeContext
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