pub struct StateSnapshot {
pub timestamp: Instant,
pub state_hash: u64,
pub fields: HashMap<String, StateValue>,
}
Expand description
Represents a snapshot of component state at a point in time
Fields§
§timestamp: Instant
Timestamp when this snapshot was taken
state_hash: u64
Hash of the state for quick comparison
fields: HashMap<String, StateValue>
Detailed state fields for diff computation
Implementations§
Source§impl StateSnapshot
impl StateSnapshot
Sourcepub fn new(fields: HashMap<String, StateValue>) -> Self
pub fn new(fields: HashMap<String, StateValue>) -> Self
Create a new state snapshot
Sourcepub fn diff(&self, other: &StateSnapshot) -> Vec<StateChange>
pub fn diff(&self, other: &StateSnapshot) -> Vec<StateChange>
Compare with another snapshot to detect changes
Trait Implementations§
Source§impl Clone for StateSnapshot
impl Clone for StateSnapshot
Source§fn clone(&self) -> StateSnapshot
fn clone(&self) -> StateSnapshot
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for StateSnapshot
impl RefUnwindSafe for StateSnapshot
impl Send for StateSnapshot
impl Sync for StateSnapshot
impl Unpin for StateSnapshot
impl UnwindSafe for StateSnapshot
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> Event for T
impl<T> Event for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert to Any for downcasting (mutable)
Source§fn event_type(&self) -> &'static str
fn event_type(&self) -> &'static str
Get the event type name
Source§impl<T> Props for T
impl<T> Props for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert to mutable Any for downcasting