Skip to main content

RuntimeObserver

Trait RuntimeObserver 

Source
pub trait RuntimeObserver {
    // Provided methods
    fn observe_enter_call_frame(
        &mut self,
        _arg_count: usize,
        _: &Rc<Lambda>,
        _call_depth: usize,
    ) { ... }
    fn observe_exit_call_frame(&mut self, _frame_at: usize, _stack: &[Value]) { ... }
    fn observe_suspend_call_frame(&mut self, _frame_at: usize, _stack: &[Value]) { ... }
    fn observe_enter_generator(
        &mut self,
        _frame_at: usize,
        _name: &str,
        _stack: &[Value],
    ) { ... }
    fn observe_exit_generator(
        &mut self,
        _frame_at: usize,
        _name: &str,
        _stack: &[Value],
    ) { ... }
    fn observe_suspend_generator(
        &mut self,
        _frame_at: usize,
        _name: &str,
        _stack: &[Value],
    ) { ... }
    fn observe_generator_request(&mut self, _name: &str, _msg: &VMRequest) { ... }
    fn observe_tail_call(&mut self, _frame_at: usize, _: &Rc<Lambda>) { ... }
    fn observe_enter_builtin(&mut self, _name: &'static str) { ... }
    fn observe_exit_builtin(&mut self, _name: &'static str, _stack: &[Value]) { ... }
    fn observe_execute_op(&mut self, _ip: CodeIdx, _: &Op, _: &[Value]) { ... }
}
Expand description

Implemented by types that wish to observe internal happenings of the Tvix virtual machine at runtime.

Provided Methods§

Source

fn observe_enter_call_frame( &mut self, _arg_count: usize, _: &Rc<Lambda>, _call_depth: usize, )

Called when the runtime enters a new call frame.

Source

fn observe_exit_call_frame(&mut self, _frame_at: usize, _stack: &[Value])

Called when the runtime exits a call frame.

Source

fn observe_suspend_call_frame(&mut self, _frame_at: usize, _stack: &[Value])

Called when the runtime suspends a call frame.

Source

fn observe_enter_generator( &mut self, _frame_at: usize, _name: &str, _stack: &[Value], )

Called when the runtime enters a generator frame.

Source

fn observe_exit_generator( &mut self, _frame_at: usize, _name: &str, _stack: &[Value], )

Called when the runtime exits a generator frame.

Source

fn observe_suspend_generator( &mut self, _frame_at: usize, _name: &str, _stack: &[Value], )

Called when the runtime suspends a generator frame.

Source

fn observe_generator_request(&mut self, _name: &str, _msg: &VMRequest)

Called when a generator requests an action from the VM.

Source

fn observe_tail_call(&mut self, _frame_at: usize, _: &Rc<Lambda>)

Called when the runtime replaces the current call frame for a tail call.

Source

fn observe_enter_builtin(&mut self, _name: &'static str)

Called when the runtime enters a builtin.

Source

fn observe_exit_builtin(&mut self, _name: &'static str, _stack: &[Value])

Called when the runtime exits a builtin.

Source

fn observe_execute_op(&mut self, _ip: CodeIdx, _: &Op, _: &[Value])

Called when the runtime begins executing an instruction. The provided stack is the state at the beginning of the operation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§