pub struct RecordedEvent {
pub timestamp_ms: u64,
pub node_id: KeyData,
pub action_name: String,
pub random_seed: u64,
}Expand description
Recorded event for session recording/replay
This type is designed for action-based recording, where actions are re-executed on replay with the same random seed for deterministic results.
§Usage
ⓘ
use glitcher_api::hooks::{RecordedEvent, ActionHook, AfterActionEvent};
struct RecordingHook {
events: Vec<RecordedEvent>,
}
impl ActionHook for RecordingHook {
fn after_action(&mut self, event: &AfterActionEvent) {
if event.result.is_ok() {
self.events.push(RecordedEvent::from_after_event(event));
}
}
}Fields§
§timestamp_ms: u64Timestamp in milliseconds since session start
node_id: KeyDataTarget node ID (stable KeyData for serialization)
action_name: StringAction name (e.g., “reset”, “randomize”)
random_seed: u64Random seed used (for deterministic replay)
Implementations§
Source§impl RecordedEvent
impl RecordedEvent
Sourcepub fn from_after_event(event: &AfterActionEvent) -> Self
pub fn from_after_event(event: &AfterActionEvent) -> Self
Create a RecordedEvent from an AfterActionEvent
Trait Implementations§
Source§impl Clone for RecordedEvent
impl Clone for RecordedEvent
Source§fn clone(&self) -> RecordedEvent
fn clone(&self) -> RecordedEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RecordedEvent
impl Debug for RecordedEvent
Source§impl<'de> Deserialize<'de> for RecordedEvent
impl<'de> Deserialize<'de> for RecordedEvent
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RecordedEvent
impl RefUnwindSafe for RecordedEvent
impl Send for RecordedEvent
impl Sync for RecordedEvent
impl Unpin for RecordedEvent
impl UnwindSafe for RecordedEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more