pub struct TransitionMeta {
pub env_id: u32,
pub episode_id: u64,
pub step_in_episode: u32,
pub global_step: u64,
pub policy_version: u64,
pub reward_model_version: u64,
pub timestamp_ns: u64,
}Expand description
Metadata attached to each transition for provenance tracking.
Fixed-size serialization: 48 bytes (little-endian). Layout: env_id(4) + episode_id(8) + step_in_episode(4) + global_step(8) + policy_version(8) + reward_model_version(8) + timestamp_ns(8) = 48
Fields§
§env_id: u32§episode_id: u64§step_in_episode: u32§global_step: u64§policy_version: u64§reward_model_version: u64§timestamp_ns: u64Implementations§
Source§impl TransitionMeta
impl TransitionMeta
Sourcepub fn new(
env_id: u32,
episode_id: u64,
step_in_episode: u32,
global_step: u64,
policy_version: u64,
) -> Self
pub fn new( env_id: u32, episode_id: u64, step_in_episode: u32, global_step: u64, policy_version: u64, ) -> Self
Create a new TransitionMeta, auto-filling timestamp_ns from the
system clock and defaulting reward_model_version to 0.
Sourcepub fn serialize(&self) -> Vec<u8> ⓘ
pub fn serialize(&self) -> Vec<u8> ⓘ
Serialize to a fixed 48-byte little-endian representation.
Sourcepub fn deserialize(bytes: &[u8]) -> Result<Self, RloxError>
pub fn deserialize(bytes: &[u8]) -> Result<Self, RloxError>
Deserialize from a 48-byte little-endian buffer.
Trait Implementations§
Source§impl Clone for TransitionMeta
impl Clone for TransitionMeta
Source§fn clone(&self) -> TransitionMeta
fn clone(&self) -> TransitionMeta
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 TransitionMeta
impl Debug for TransitionMeta
Source§impl<'de> Deserialize<'de> for TransitionMeta
impl<'de> Deserialize<'de> for TransitionMeta
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
Source§impl PartialEq for TransitionMeta
impl PartialEq for TransitionMeta
Source§impl Serialize for TransitionMeta
impl Serialize for TransitionMeta
impl StructuralPartialEq for TransitionMeta
Auto Trait Implementations§
impl Freeze for TransitionMeta
impl RefUnwindSafe for TransitionMeta
impl Send for TransitionMeta
impl Sync for TransitionMeta
impl Unpin for TransitionMeta
impl UnwindSafe for TransitionMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more