Skip to main content

CallbackCollector

Struct CallbackCollector 

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

Source

pub fn frame_interval(&self) -> usize

Returns the configured callback cadence in processed frames.

Source§

impl<C> CallbackCollector<C>

Source

pub fn new(callback: C) -> Self

Creates a collector that invokes the callback for every processed frame.

Source

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>

Source§

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,

Process an entire replay. Read more
Source§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.