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>
impl<W: Write> TracingObserver<W>
pub fn new(writer: W) -> Self
sourcepub fn enable_timing(&mut self)
pub fn enable_timing(&mut self)
Write the time of each runtime event, relative to when this method is called
fn maybe_write_time(&mut self)
fn write_value(&mut self, val: &Value)
fn write_stack(&mut self, stack: &[Value])
Trait Implementations§
source§impl<W: Write> Drop for TracingObserver<W>
impl<W: Write> Drop for TracingObserver<W>
source§impl<W: Write> RuntimeObserver for TracingObserver<W>
impl<W: Write> RuntimeObserver for TracingObserver<W>
source§fn observe_exit_call_frame(&mut self, frame_at: usize, stack: &[Value])
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,
)
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])
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],
)
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],
)
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],
)
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)
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)
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])
fn observe_exit_builtin(&mut self, name: &'static str, stack: &[Value])
Called when the runtime exits a builtin.
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> 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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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