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, _: &OpCode, _: &[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, _: &OpCode, _: &[Value])

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

Implementors§