pub trait TraceSink {
// Required methods
fn source(&self) -> TraceSource;
fn record_event(&mut self, event: &TraceEvent) -> Result<(), String>;
fn record_snapshot(
&mut self,
bus: &MacMemoryBus,
screen_mode: (u32, u32, u16, u16, u16),
palette: &[[u16; 3]; 256],
screen_event_count: u64,
tick: u32,
instructions: u64,
) -> Result<SnapshotEntry, String>;
}Expand description
Destination for runtime trace output. The dispatcher emits events and
screen snapshots to whichever sink the host installs; the sink decides
how (and whether) to persist them. Errors are surfaced as String and
wrapped by the runtime as crate::error::Error::Trace.
Required Methods§
Sourcefn source(&self) -> TraceSource
fn source(&self) -> TraceSource
The backend this sink is recording for.
Sourcefn record_event(&mut self, event: &TraceEvent) -> Result<(), String>
fn record_event(&mut self, event: &TraceEvent) -> Result<(), String>
Persist one structured event.
Sourcefn record_snapshot(
&mut self,
bus: &MacMemoryBus,
screen_mode: (u32, u32, u16, u16, u16),
palette: &[[u16; 3]; 256],
screen_event_count: u64,
tick: u32,
instructions: u64,
) -> Result<SnapshotEntry, String>
fn record_snapshot( &mut self, bus: &MacMemoryBus, screen_mode: (u32, u32, u16, u16, u16), palette: &[[u16; 3]; 256], screen_event_count: u64, tick: u32, instructions: u64, ) -> Result<SnapshotEntry, String>
Capture the current framebuffer as a snapshot. screen_mode is
(base, row_bytes, width, height, depth); palette is the active
256-entry CLUT.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".