#![expect(clippy::todo, reason = "skeleton: #6833")]
use alloc::vec::Vec;
use super::{PassEvent, PassObserver};
pub trait Clock {
fn now_ns(&self) -> u64;
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct PassTiming {
pub pass: &'static str,
pub elapsed_ns: u64,
}
#[derive(Debug, Clone)]
pub struct TimingObserver<C: Clock> {
clock: C,
timings: Vec<PassTiming>,
}
impl<C: Clock> TimingObserver<C> {
#[must_use]
pub const fn new(clock: C) -> Self {
Self {
clock,
timings: Vec::new(),
}
}
#[must_use]
pub fn timings(&self) -> &[PassTiming] {
&self.timings
}
}
impl<C: Clock> PassObserver for TimingObserver<C> {
fn before_pass(&mut self, event: &PassEvent<'_>) {
let _ = (event, self.clock.now_ns());
todo!()
}
fn after_pass(&mut self, event: &PassEvent<'_>) {
let _ = event;
todo!()
}
}