pub struct StateSnapshotEvent<StateT = Value>where
StateT: AgentState,{
pub base: BaseEvent,
pub snapshot: StateT,
}Expand description
Event containing a complete state snapshot.
This event is sent to provide the full current state of the agent.
The state is generic over StateT which must implement AgentState.
§Type Parameter
StateT: The type of state, defaults toJsonValuefor flexibility.
Fields§
§base: BaseEventCommon event fields (timestamp, rawEvent).
snapshot: StateTThe complete state snapshot.
Implementations§
Source§impl<StateT> StateSnapshotEvent<StateT>where
StateT: AgentState,
impl<StateT> StateSnapshotEvent<StateT>where
StateT: AgentState,
Sourcepub fn new(snapshot: StateT) -> StateSnapshotEvent<StateT>
pub fn new(snapshot: StateT) -> StateSnapshotEvent<StateT>
Creates a new StateSnapshotEvent with the given state.
Sourcepub fn with_timestamp(self, timestamp: f64) -> StateSnapshotEvent<StateT>
pub fn with_timestamp(self, timestamp: f64) -> StateSnapshotEvent<StateT>
Sets the timestamp for this event.
Trait Implementations§
Source§impl<StateT> Clone for StateSnapshotEvent<StateT>where
StateT: Clone + AgentState,
impl<StateT> Clone for StateSnapshotEvent<StateT>where
StateT: Clone + AgentState,
Source§fn clone(&self) -> StateSnapshotEvent<StateT>
fn clone(&self) -> StateSnapshotEvent<StateT>
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<StateT> Debug for StateSnapshotEvent<StateT>where
StateT: Debug + AgentState,
impl<StateT> Debug for StateSnapshotEvent<StateT>where
StateT: Debug + AgentState,
Source§impl<StateT> Default for StateSnapshotEvent<StateT>where
StateT: AgentState + Default,
impl<StateT> Default for StateSnapshotEvent<StateT>where
StateT: AgentState + Default,
Source§fn default() -> StateSnapshotEvent<StateT>
fn default() -> StateSnapshotEvent<StateT>
Returns the “default value” for a type. Read more
Source§impl<'de, StateT> Deserialize<'de> for StateSnapshotEvent<StateT>where
StateT: AgentState,
impl<'de, StateT> Deserialize<'de> for StateSnapshotEvent<StateT>where
StateT: AgentState,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StateSnapshotEvent<StateT>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StateSnapshotEvent<StateT>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<StateT> PartialEq for StateSnapshotEvent<StateT>where
StateT: PartialEq + AgentState,
impl<StateT> PartialEq for StateSnapshotEvent<StateT>where
StateT: PartialEq + AgentState,
Source§impl<StateT> Serialize for StateSnapshotEvent<StateT>where
StateT: AgentState + Serialize,
impl<StateT> Serialize for StateSnapshotEvent<StateT>where
StateT: AgentState + Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<StateT> StructuralPartialEq for StateSnapshotEvent<StateT>where
StateT: AgentState,
Auto Trait Implementations§
impl<StateT> Freeze for StateSnapshotEvent<StateT>where
StateT: Freeze,
impl<StateT> RefUnwindSafe for StateSnapshotEvent<StateT>where
StateT: RefUnwindSafe,
impl<StateT> Send for StateSnapshotEvent<StateT>
impl<StateT> Sync for StateSnapshotEvent<StateT>
impl<StateT> Unpin for StateSnapshotEvent<StateT>where
StateT: Unpin,
impl<StateT> UnsafeUnpin for StateSnapshotEvent<StateT>where
StateT: UnsafeUnpin,
impl<StateT> UnwindSafe for StateSnapshotEvent<StateT>where
StateT: 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