pub trait Collector: Sized {
    // Required method
    fn process_frame(
        &mut self,
        processor: &ReplayProcessor<'_>,
        frame: &Frame,
        frame_number: usize,
        current_time: f32
    ) -> SubtrActorResult<TimeAdvance>;

    // Provided method
    fn process_replay(self, replay: &Replay) -> SubtrActorResult<Self> { ... }
}
Expand description

Trait for types that collect data from a replay.

A Collector processes frames from a replay, potentially using a ReplayProcessor for access to additional replay data and context. It determines the pace of replay progression via the TimeAdvance return value.

Required Methods§

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.

Arguments
  • processor - The ReplayProcessor providing context for the replay.
  • frame - The boxcars::Frame to process.
  • frame_number - The number of the current frame.
  • current_time - The current target time in the replay.
Returns

Returns a TimeAdvance enum which determines the next step in replay progression.

Provided Methods§

source

fn process_replay(self, replay: &Replay) -> SubtrActorResult<Self>

Process an entire replay.

Arguments
Returns

Returns the Collector itself, potentially modified by the processing of the replay.

Implementors§