pub struct Event {Show 16 fields
pub id: Uuid,
pub namespace: String,
pub verb: String,
pub substrate: SubstrateKind,
pub actor: String,
pub kind: EventKind,
pub outcome: EventOutcome,
pub payload: Value,
pub payload_schema_version: u32,
pub profile_state_version: Option<u64>,
pub duration_us: i64,
pub target_id: Option<Uuid>,
pub session_id: Option<Uuid>,
pub aggregate_kind: Option<String>,
pub aggregate_id: Option<Uuid>,
pub created_at: i64,
}Expand description
Storage-level event record. Every verb execution produces one. Immutable once appended; projection rows are written beside it at append time.
Fields§
§id: Uuid§namespace: String§verb: String§substrate: SubstrateKind§actor: String§kind: EventKind§outcome: EventOutcome§payload: Value§payload_schema_version: u32§profile_state_version: Option<u64>§duration_us: i64§target_id: Option<Uuid>§session_id: Option<Uuid>§aggregate_kind: Option<String>§aggregate_id: Option<Uuid>§created_at: i64Implementations§
Source§impl Event
impl Event
pub fn new( namespace: impl Into<String>, verb: impl Into<String>, kind: EventKind, substrate: SubstrateKind, actor: impl Into<String>, ) -> Self
pub fn with_outcome(self, o: EventOutcome) -> Self
pub fn with_payload(self, payload: Value) -> Self
pub fn with_payload_schema_version(self, version: u32) -> Self
pub fn with_profile_state_version(self, version: u64) -> Self
pub fn with_duration_us(self, us: i64) -> Self
pub fn with_target(self, id: Uuid) -> Self
pub fn with_session_id(self, id: Uuid) -> Self
pub fn with_aggregate(self, kind: impl Into<String>, id: Uuid) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
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 Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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