pub struct ReplayBufferState { /* private fields */ }Expand description
Host-owned snapshot of a ReplayBuffer, including exact circular cursor
position and active transition payloads.
Implementations§
Source§impl ReplayBufferState
impl ReplayBufferState
Sourcepub const fn config(&self) -> &ReplayConfig
pub const fn config(&self) -> &ReplayConfig
Return the replay schema recorded in this snapshot.
Sourcepub const fn cursor(&self) -> usize
pub const fn cursor(&self) -> usize
Return the circular physical write cursor recorded in this snapshot.
Sourcepub fn encode(&self) -> Result<Vec<u8>>
pub fn encode(&self) -> Result<Vec<u8>>
Serialize this snapshot into a self-describing, checksum-protected binary payload.
§Errors
Returns an error if the snapshot fails internal invariant validation.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self>
pub fn decode(bytes: &[u8]) -> Result<Self>
Decode and integrity-check a binary replay snapshot.
§Errors
Returns crate::ErrorKind::CheckpointCorrupt for bad magic, unknown
version, checksum mismatch, truncation, trailing bytes, or invariant
violations.
Trait Implementations§
Source§impl Clone for ReplayBufferState
impl Clone for ReplayBufferState
Source§impl Debug for ReplayBufferState
impl Debug for ReplayBufferState
Source§impl PartialEq for ReplayBufferState
impl PartialEq for ReplayBufferState
impl StructuralPartialEq for ReplayBufferState
Auto Trait Implementations§
impl Forget for ReplayBufferState
impl Freeze for ReplayBufferStatewhere
*const u8 is !null: Freeze,
PhantomData<usize>: Freeze,
PhantomData<f32>: Freeze,
PhantomData<u8>: Freeze,
impl Move for ReplayBufferState
impl RefUnwindSafe for ReplayBufferState
impl Send for ReplayBufferStatewhere
RawVecInner: Send,
impl Sync for ReplayBufferStatewhere
RawVecInner: Sync,
impl Unpin for ReplayBufferState
impl UnsafeUnpin for ReplayBufferStatewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<f32>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for ReplayBufferStatewhere
RawVecInner: UnwindSafe,
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