Trait subtr_actor::collector::Collector
source · 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§
sourcefn 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.
Arguments
processor
- TheReplayProcessor
providing context for the replay.frame
- Theboxcars::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§
sourcefn process_replay(self, replay: &Replay) -> SubtrActorResult<Self>
fn process_replay(self, replay: &Replay) -> SubtrActorResult<Self>
Process an entire replay.
Arguments
replay
- Theboxcars::Replay
to process.
Returns
Returns the Collector
itself, potentially modified by the processing
of the replay.