pub struct Message {Show 14 fields
pub uid: String,
pub topic: Topic,
pub key: String,
pub kind: String,
pub source: String,
pub occurred_at: DateTime<Utc>,
pub headers: Headers,
pub payload: Bytes,
pub content_type: Option<String>,
pub event_version: Option<String>,
pub idempotency_key: Option<String>,
pub expires_at: Option<DateTime<Utc>>,
pub trace_uid: Option<String>,
pub correlation_uid: Option<String>,
}Fields§
§uid: String§topic: Topic§key: String§kind: String§source: String§occurred_at: DateTime<Utc>§headers: Headers§payload: Bytes§content_type: Option<String>§event_version: Option<String>§idempotency_key: Option<String>§expires_at: Option<DateTime<Utc>>§trace_uid: Option<String>§correlation_uid: Option<String>Implementations§
Source§impl Message
impl Message
pub fn set_schema(&mut self, content_type: &str, event_version: &str)
pub fn schema(&self) -> SchemaDescriptor
pub fn set_trace_context( &mut self, ctx: &TraceContext, ) -> Result<(), EventBusError>
pub fn trace_context(&self) -> TraceContext
pub fn set_idempotency_key(&mut self, key: &str)
pub fn idempotency_key(&self) -> Option<&str>
Sourcepub fn normalize(&mut self)
pub fn normalize(&mut self)
Hoist header values into typed fields when the typed field is unset.
Backends call this after deserializing wire-format messages so that
downstream consumers can rely on the typed fields as the single source
of truth. This preserves wire compatibility with producers that only
set headers (e.g., the Go StreamBus).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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 Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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