pub fn flush(&mut self) {
        match &mut self.mode {
            LoopriderMode::Playback => {
                while matches!(self.records.last(), Some(record) if record.record <= self.record) {
                    let record = self.records.pop().unwrap();
                    assert_eq!(
                        record.record, self.record,
                        "a looprider tick was skipped! replay frame mismatch"
                    );
                    self.channel.iter_write(record.events);
                }
            }
            LoopriderMode::Record { buf } => {
                if !buf.is_empty() {
                    self.records.push(Record {
                        record: self.record,
                        events: buf.clone(),
                    });

                    self.channel.drain_vec_write(buf);
                }
            }
        }

        self.record += 1;
    }
/// Update the [`Looprider`] by flushing its internal buffers and incrementing its record
/// counter. You can call this multiple times per frame, but it should be ensured that the
/// number of times it is called per frame is deterministic - otherwise, replays will play back
/// the wrong records at the wrong `flush` calls. It's worth noting that `Looprider` will have
/// serious problems with a game running at a variable delta-time; `Looprider` should *only* be
/// used with a fixed timestep.
Update the [`Looprider`] by flushing its internal buffers and incrementing its record
counter. You can call this multiple times per frame, but it should be ensured that the
number of times it is called per frame is deterministic - otherwise, replays will play back
the wrong records at the wrong `flush` calls. It's worth noting that `Looprider` will have
serious problems with a game running at a variable delta-time; `Looprider` should *only* be
used with a fixed timestep.
Update the [ ` Looprider ` ] by flushing its internal buffers and incrementing its record counter . You can call this multiple times per frame but it should be ensured that the number of times it is called per frame is deterministic - otherwise replays will play back the wrong records at the wrong ` flush ` calls . It ' s worth noting that ` Looprider ` will have serious problems with a game running at a variable delta - time ; ` Looprider ` should * only * be used with a fixed timestep .
pub fn flush(&mut self) {
        match &mut self.mode {
            LoopriderMode::Playback => {
                while matches!(self.records.last(), Some(record) if record.record <= self.record) {
                    let record = self.records.pop().unwrap();
                    assert_eq!(
                        record.record, self.record,
                        "a looprider tick was skipped! replay frame mismatch"
                    );
                    self.channel.iter_write(record.events);
                }
            }
            LoopriderMode::Record { buf } => {
                if !buf.is_empty() {
                    self.records.push(Record {
                        record: self.record,
                        events: buf.clone(),
                    });
                    self.channel.drain_vec_write(buf);
                }
            }
        }
        self.record += 1;
    }
pub fn flush ( & mut self ) { match & mut self . mode { LoopriderMode :: Playback => { while matches ! ( self records last ( ) Some ( record ) if record record self record ) { let record = self . records . pop ( ) . unwrap ( ) ; assert_eq ! ( record record self record " " ) ; self . channel . iter_write ( record . events ) ; } } LoopriderMode :: Record { buf } => { if ! buf . is_empty ( ) { self . records . push ( Record { record : self . record , events : buf . clone ( ) , } ) ; self . channel . drain_vec_write ( buf ) ; } } } self . record += 1 ; }
Update the [`Looprider`] by flushing its internal buffers and incrementing its record
counter.
Update the [ ` Looprider ` ] by flushing its internal buffers and incrementing its record counter .
&mut self
&mut self