pub struct EventStream {Show 21 fields
pub id: Uuid,
pub session_id: Uuid,
pub tenant_id: Uuid,
pub event_source: String,
pub event_type: String,
pub timestamp: DateTime<Utc>,
pub created_by: String,
pub md5_hash: String,
pub request_id: Option<Uuid>,
pub owner_id: Option<String>,
pub product_id: Option<Uuid>,
pub product_schema_uri: Option<String>,
pub event_source_uri: Option<String>,
pub affected_entity_uri: Option<String>,
pub message: Option<String>,
pub payload: Option<Value>,
pub payload_uri: Option<String>,
pub context: Option<Value>,
pub context_uri: Option<String>,
pub metadata: Option<Value>,
pub tags: Option<Value>,
}
Expand description
Generic Event-Stream envelope (Event V1).
This struct matches the Event V1 schema exactly. All required and optional fields are included, with correct types.
Fields§
§id: Uuid
§session_id: Uuid
§tenant_id: Uuid
§event_source: String
§event_type: String
§timestamp: DateTime<Utc>
§created_by: String
§md5_hash: String
§request_id: Option<Uuid>
§owner_id: Option<String>
§product_id: Option<Uuid>
§product_schema_uri: Option<String>
§event_source_uri: Option<String>
§affected_entity_uri: Option<String>
§message: Option<String>
§payload: Option<Value>
§payload_uri: Option<String>
§context: Option<Value>
§context_uri: Option<String>
§metadata: Option<Value>
Implementations§
Source§impl EventStream
impl EventStream
Sourcefn compute_payload_hash(payload: &Option<Value>) -> String
fn compute_payload_hash(payload: &Option<Value>) -> String
Sourcepub fn new(
session_id: Uuid,
tenant_id: Uuid,
event_source: String,
event_type: String,
created_by: String,
request_id: Option<Uuid>,
owner_id: Option<String>,
product_id: Option<Uuid>,
product_schema_uri: Option<String>,
event_source_uri: Option<String>,
affected_entity_uri: Option<String>,
message: Option<String>,
payload: Option<Value>,
payload_uri: Option<String>,
context: Option<Value>,
context_uri: Option<String>,
metadata: Option<Value>,
tags: Option<Value>,
) -> Self
pub fn new( session_id: Uuid, tenant_id: Uuid, event_source: String, event_type: String, created_by: String, request_id: Option<Uuid>, owner_id: Option<String>, product_id: Option<Uuid>, product_schema_uri: Option<String>, event_source_uri: Option<String>, affected_entity_uri: Option<String>, message: Option<String>, payload: Option<Value>, payload_uri: Option<String>, context: Option<Value>, context_uri: Option<String>, metadata: Option<Value>, tags: Option<Value>, ) -> Self
Create a new EventStream
§Arguments
session_id
- The session IDtenant_id
- The tenant IDevent_source
- The event sourceevent_type
- The event typecreated_by
- The created byrequest_id
- The request IDowner_id
- The owner IDproduct_id
- The product IDproduct_schema_uri
- The product schema URIevent_source_uri
- The event source URIaffected_entity_uri
- The affected entity URImessage
- The messagepayload
- The payloadpayload_uri
- The payload URIcontext
- The contextcontext_uri
- The context URImetadata
- The metadatatags
- The tags
§Returns
EventStream
- The new EventStream
Trait Implementations§
Source§impl Debug for EventStream
impl Debug for EventStream
Source§impl<'de> Deserialize<'de> for EventStream
impl<'de> Deserialize<'de> for EventStream
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 EventStream
impl RefUnwindSafe for EventStream
impl Send for EventStream
impl Sync for EventStream
impl Unpin for EventStream
impl UnwindSafe for EventStream
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