pub struct ChangeEvent {
pub speaker_id: SpeakerId,
pub change: PropertyChange,
pub source: ChangeSource,
pub timestamp: Instant,
}Expand description
A change event emitted when a watched property changes.
Carries the new value as a typed PropertyChange, so a consumer draining
a backlog observes every value the property passed through rather than
whatever the store happens to hold by the time it looks. That distinction
matters: a Playing -> Transitioning -> Playing sequence is three queued
events but only one final store value, and re-reading the store would make
the middle state — and the fact that anything moved at all — invisible.
property_key() and service() are derived from the payload rather than
stored beside it, so the two cannot drift apart.
Fields§
§speaker_id: SpeakerIdSpeaker or entity that changed
change: PropertyChangeThe new value, typed
source: ChangeSourceWhat produced this value
timestamp: InstantWhen the change was observed
Implementations§
Source§impl ChangeEvent
impl ChangeEvent
pub fn new( speaker_id: SpeakerId, change: PropertyChange, stamp: WriteStamp, ) -> ChangeEvent
Sourcepub fn property_key(&self) -> &'static str
pub fn property_key(&self) -> &'static str
The key of the property that changed.
Trait Implementations§
Source§impl Clone for ChangeEvent
impl Clone for ChangeEvent
Source§fn clone(&self) -> ChangeEvent
fn clone(&self) -> ChangeEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ChangeEvent
impl RefUnwindSafe for ChangeEvent
impl Send for ChangeEvent
impl Sync for ChangeEvent
impl Unpin for ChangeEvent
impl UnsafeUnpin for ChangeEvent
impl UnwindSafe for ChangeEvent
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