pub struct CallbackCollector<C> { /* private fields */ }Expand description
A lightweight collector that invokes a callback at a configurable frame cadence.
This is useful for side effects that should observe replay traversal without owning replay-derived state, such as progress reporting, instrumentation, or debugging hooks.
Implementations§
Source§impl<C> CallbackCollector<C>
impl<C> CallbackCollector<C>
Sourcepub fn frame_interval(&self) -> usize
pub fn frame_interval(&self) -> usize
Returns the configured callback cadence in processed frames.
Source§impl<C> CallbackCollector<C>
impl<C> CallbackCollector<C>
Sourcepub fn new(callback: C) -> Self
pub fn new(callback: C) -> Self
Creates a collector that invokes the callback for every processed frame.
Sourcepub fn with_frame_interval(callback: C, frame_interval: usize) -> Self
pub fn with_frame_interval(callback: C, frame_interval: usize) -> Self
Creates a collector that invokes the callback every frame_interval
processed frames.
A frame_interval of 0 is normalized to 1.
Trait Implementations§
Source§impl<C> Collector for CallbackCollector<C>
impl<C> Collector for CallbackCollector<C>
Source§fn process_frame(
&mut self,
_processor: &ReplayProcessor<'_>,
frame: &Frame,
frame_number: usize,
current_time: f32,
) -> SubtrActorResult<TimeAdvance>
fn process_frame( &mut self, _processor: &ReplayProcessor<'_>, frame: &Frame, frame_number: usize, current_time: f32, ) -> SubtrActorResult<TimeAdvance>
Process a single frame from a replay. Read more
Source§fn process_replay(self, replay: &Replay) -> SubtrActorResult<Self>where
Self: Sized,
fn process_replay(self, replay: &Replay) -> SubtrActorResult<Self>where
Self: Sized,
Process an entire replay. Read more
Source§fn finish_replay(
&mut self,
_processor: &ReplayProcessor<'_>,
) -> SubtrActorResult<()>
fn finish_replay( &mut self, _processor: &ReplayProcessor<'_>, ) -> SubtrActorResult<()>
Finalize replay-derived state after the last frame has been processed. Read more
Auto Trait Implementations§
impl<C> Freeze for CallbackCollector<C>where
C: Freeze,
impl<C> RefUnwindSafe for CallbackCollector<C>where
C: RefUnwindSafe,
impl<C> Send for CallbackCollector<C>where
C: Send,
impl<C> Sync for CallbackCollector<C>where
C: Sync,
impl<C> Unpin for CallbackCollector<C>where
C: Unpin,
impl<C> UnsafeUnpin for CallbackCollector<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for CallbackCollector<C>where
C: 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