pub struct MetadataContext {
pub correlation_id: Uuid,
pub default_target: Option<String>,
}Expand description
Metadata context for event emission.
Holds configuration and state used when creating events.
Fields§
§correlation_id: UuidThe correlation ID for this context.
default_target: Option<String>Optional default target for events.
Implementations§
Source§impl MetadataContext
impl MetadataContext
Sourcepub fn with_correlation_id(id: Uuid) -> Self
pub fn with_correlation_id(id: Uuid) -> Self
Create a new metadata context with a specific correlation ID.
Sourcepub fn with_target(self, target: impl Into<String>) -> Self
pub fn with_target(self, target: impl Into<String>) -> Self
Set a default target for events created with this context.
Trait Implementations§
Source§impl Clone for MetadataContext
impl Clone for MetadataContext
Source§fn clone(&self) -> MetadataContext
fn clone(&self) -> MetadataContext
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetadataContext
impl Debug for MetadataContext
Auto Trait Implementations§
impl Freeze for MetadataContext
impl RefUnwindSafe for MetadataContext
impl Send for MetadataContext
impl Sync for MetadataContext
impl Unpin for MetadataContext
impl UnwindSafe for MetadataContext
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)