pub struct EventPayload {
pub id: Uuid,
pub timestamp: DateTime<Utc>,
pub event: PunchEvent,
pub correlation_id: Option<Uuid>,
}Expand description
A timestamped event with metadata.
Fields§
§id: UuidUnique identifier for this event instance.
timestamp: DateTime<Utc>When the event occurred.
event: PunchEventThe event data.
correlation_id: Option<Uuid>Optional correlation ID for tracing related events.
Implementations§
Source§impl EventPayload
impl EventPayload
Sourcepub fn new(event: PunchEvent) -> Self
pub fn new(event: PunchEvent) -> Self
Create a new EventPayload with the current timestamp.
Sourcepub fn with_correlation(self, correlation_id: Uuid) -> Self
pub fn with_correlation(self, correlation_id: Uuid) -> Self
Attach a correlation ID for event tracing.
Trait Implementations§
Source§impl Clone for EventPayload
impl Clone for EventPayload
Source§fn clone(&self) -> EventPayload
fn clone(&self) -> EventPayload
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 EventPayload
impl Debug for EventPayload
Source§impl<'de> Deserialize<'de> for EventPayload
impl<'de> Deserialize<'de> for EventPayload
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
Auto Trait Implementations§
impl Freeze for EventPayload
impl RefUnwindSafe for EventPayload
impl Send for EventPayload
impl Sync for EventPayload
impl Unpin for EventPayload
impl UnsafeUnpin for EventPayload
impl UnwindSafe for EventPayload
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