pub struct EventMetadata {
pub causation_id: Option<EventId>,
pub correlation_id: Option<EventId>,
pub user_id: Option<String>,
pub headers: HashMap<String, String>,
}Expand description
Metadata associated with events for tracing, correlation, and context.
EventMetadata provides essential context for event processing:
- Causation and correlation IDs for distributed tracing
- User context for audit trails
- Custom headers for additional context
§Example
use eventuali_core::EventMetadata;
use uuid::Uuid;
use std::collections::HashMap;
let mut metadata = EventMetadata::default();
metadata.user_id = Some("user-123".to_string());
metadata.correlation_id = Some(Uuid::new_v4());
metadata.headers.insert("source".to_string(), "web-app".to_string());Fields§
§causation_id: Option<EventId>§correlation_id: Option<EventId>§user_id: Option<String>§headers: HashMap<String, String>Trait Implementations§
Source§impl Clone for EventMetadata
impl Clone for EventMetadata
Source§fn clone(&self) -> EventMetadata
fn clone(&self) -> EventMetadata
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 EventMetadata
impl Debug for EventMetadata
Source§impl Default for EventMetadata
impl Default for EventMetadata
Source§fn default() -> EventMetadata
fn default() -> EventMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EventMetadata
impl<'de> Deserialize<'de> for EventMetadata
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 EventMetadata
impl PartialEq for EventMetadata
Source§impl Serialize for EventMetadata
impl Serialize for EventMetadata
impl StructuralPartialEq for EventMetadata
Auto Trait Implementations§
impl Freeze for EventMetadata
impl RefUnwindSafe for EventMetadata
impl Send for EventMetadata
impl Sync for EventMetadata
impl Unpin for EventMetadata
impl UnwindSafe for EventMetadata
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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