pub struct InputRecording { /* private fields */ }Expand description
A recorded input session: the backend size it was captured against, plus a timed sequence of events.
Each event’s Duration is the delay since the previous recorded event (or since the
start of the recording, for the first one), not an absolute timestamp measured from session
start – see push. That’s the shape TestHarness::replay needs to
reproduce recorded pacing faithfully instead of collapsing every gap to zero.
no_std + alloc compatible, gated on the testing feature like the rest of this module.
Serialize/Deserialize are additionally gated on
serde: driving a recording back through a live App within the same process (what this
type and TestHarness::replay do) needs no serialization at all; turning a
recording into bytes on disk (the .rgrec format) is retroglyph-recorder’s job, built on
top of these derives.
Implementations§
Source§impl InputRecording
impl InputRecording
Sourcepub const fn new(width: u16, height: u16) -> Self
pub const fn new(width: u16, height: u16) -> Self
Creates an empty recording for a width x height backend.
Sourcepub fn push(&mut self, delay: Duration, event: Event)
pub fn push(&mut self, delay: Duration, event: Event)
Appends event, delay after the previously appended event (or after the start of the
recording, for the first).
Trait Implementations§
Source§impl Clone for InputRecording
impl Clone for InputRecording
Source§fn clone(&self) -> InputRecording
fn clone(&self) -> InputRecording
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InputRecording
impl Debug for InputRecording
Source§impl<'de> Deserialize<'de> for InputRecording
impl<'de> Deserialize<'de> for InputRecording
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for InputRecording
impl PartialEq for InputRecording
Source§fn eq(&self, other: &InputRecording) -> bool
fn eq(&self, other: &InputRecording) -> bool
self and other values to be equal, and is used by ==.