pub struct EventRecorder {
pub steps: Vec<RecordedStep>,
}Expand description
确定性事件录像机(支持导出 .vlxrec 紧凑文本格式供线上 Bug 复现)。
Fields§
§steps: Vec<RecordedStep>Implementations§
Source§impl EventRecorder
impl EventRecorder
pub fn new() -> Self
pub fn clear(&mut self)
Sourcepub fn record_dispatch(
&mut self,
engine: &mut VeloxEngine,
dt_ms: u16,
event: InputEvent,
) -> bool
pub fn record_dispatch( &mut self, engine: &mut VeloxEngine, dt_ms: u16, event: InputEvent, ) -> bool
录制一次事件派发 + 步进帧的完整确定性快照。
Sourcepub fn record_tick(&mut self, engine: &mut VeloxEngine, dt_ms: u16)
pub fn record_tick(&mut self, engine: &mut VeloxEngine, dt_ms: u16)
仅录制一次虚拟时钟步进帧。
Sourcepub fn to_vlxrec_text(&self) -> String
pub fn to_vlxrec_text(&self) -> String
序列化为人类可读且极紧凑的 .vlxrec 录像文本。
Trait Implementations§
Source§impl Clone for EventRecorder
impl Clone for EventRecorder
Source§impl Debug for EventRecorder
impl Debug for EventRecorder
Auto Trait Implementations§
impl Forget for EventRecorder
impl Freeze for EventRecorder
impl Move for EventRecorder
impl RefUnwindSafe for EventRecorder
impl Send for EventRecorder
impl Sync for EventRecorder
impl Unpin for EventRecorder
impl UnsafeUnpin for EventRecorder
impl UnwindSafe for EventRecorder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。