Struct tvix_eval::observer::TracingObserver

source ·
pub struct TracingObserver<W: Write> {
    last_event: Option<Instant>,
    writer: TabWriter<W>,
}
Expand description

An observer that collects a textual representation of an entire runtime execution.

Fields§

§last_event: Option<Instant>§writer: TabWriter<W>

Implementations§

source§

impl<W: Write> TracingObserver<W>

source

pub fn new(writer: W) -> Self

source

pub fn enable_timing(&mut self)

Write the time of each runtime event, relative to when this method is called

source

fn maybe_write_time(&mut self)

source

fn write_value(&mut self, val: &Value)

source

fn write_stack(&mut self, stack: &[Value])

Trait Implementations§

source§

impl<W: Write> Drop for TracingObserver<W>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<W: Write> RuntimeObserver for TracingObserver<W>

source§

fn observe_exit_call_frame(&mut self, frame_at: usize, stack: &[Value])

Called when the runtime exits a call frame.

source§

fn observe_enter_call_frame( &mut self, arg_count: usize, lambda: &Rc<Lambda>, call_depth: usize, )

Called when the runtime enters a new 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_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_tail_call(&mut self, frame_at: usize, lambda: &Rc<Lambda>)

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

fn observe_execute_op(&mut self, ip: CodeIdx, op: &Op, stack: &[Value])

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

Auto Trait Implementations§

§

impl<W> Freeze for TracingObserver<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for TracingObserver<W>
where W: RefUnwindSafe,

§

impl<W> Send for TracingObserver<W>
where W: Send,

§

impl<W> Sync for TracingObserver<W>
where W: Sync,

§

impl<W> Unpin for TracingObserver<W>
where W: Unpin,

§

impl<W> UnwindSafe for TracingObserver<W>
where W: UnwindSafe,

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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

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

source§

fn vzip(self) -> V