Struct Replay

pub struct Replay { /* private fields */ }

Implementations§

§

impl Replay

pub fn record(&mut self, frame: Frame) -> bool

pub fn frame_at(&self, tick: u64) -> Option<&Frame>

Exact tick lookup in the original FXRP0001 input stream.

pub fn frame_before_or_at(&self, tick: u64) -> Option<&Frame>

Most recent input at or before a tick; gaps do not invent new frames.

pub fn slice_ticks(&self, first: u64, last: u64) -> Replay

Export an inclusive tick range. Reversed bounds produce an empty stream.

pub fn truncate_from(&mut self, tick: u64) -> usize

Discard frames at or after tick, allowing a simulation to record a new branch.

pub fn first_divergence(&self, other: &Replay) -> Option<u64>

Earliest tick with different state hashes or missing coverage. Inputs are intentionally ignored: hashes are supplied by the simulation host.

pub fn frames(&self) -> &[Frame]

pub fn encode(&self) -> Vec<u8> ⓘ

pub fn decode(data: &[u8]) -> Option<Replay>

Trait Implementations§

§

impl Default for Replay

§

fn default() -> Replay

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Replay

§

impl RefUnwindSafe for Replay

§

impl Send for Replay

§

impl Sync for Replay

§

impl Unpin for Replay

§

impl UnwindSafe for Replay

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.