pub struct StoredEvent {Show 14 fields
pub position: u64,
pub tenant: String,
pub domain: String,
pub aggregate_type: String,
pub aggregate_id: String,
pub version: u64,
pub event_type: String,
pub schema: u32,
pub data: Value,
pub redacted: Vec<String>,
pub command_id: String,
pub created_at: Timestamp,
pub request: RequestContext,
pub deployment: String,
}Expand description
An event as stored by the kernel: in an Outcome and in a Kernable::subscribe
handler.
Fields§
§position: u64Global position of the event in the kernel’s log.
tenant: String§domain: StringAlways the domain of the command that caused the event.
aggregate_type: String§aggregate_id: String§version: u64The aggregate’s version after this event: 1 for its first event.
event_type: StringThe event type within the domain, e.g. ItemAdded.
schema: u32Version of the payload format. Listeners get data upcast to the version they know
(see Domain::event), unless the handler is raw.
data: ValueThe payload; StoredEvent::parse deserializes it.
redacted: Vec<String>Fields kept in the vault whose value is not here (null in data): erased, or not
readable with this key (granted vault_read).
command_id: StringThe command that caused the event.
created_at: TimestampWhen the kernel committed the event.
request: RequestContextThe request context of the command that caused the event.
deployment: StringThe code version of the worker that wrote it (Options::deployment); empty if none.
Implementations§
Source§impl StoredEvent
impl StoredEvent
Sourcepub fn parse<D: DeserializeOwned>(&self) -> Result<D, Error>
pub fn parse<D: DeserializeOwned>(&self) -> Result<D, Error>
data as a D, e.g. let item: ItemAdded = event.parse()?;.
Trait Implementations§
Source§impl Clone for StoredEvent
impl Clone for StoredEvent
Source§impl Debug for StoredEvent
impl Debug for StoredEvent
Source§impl PartialEq for StoredEvent
impl PartialEq for StoredEvent
impl StructuralPartialEq for StoredEvent
Auto Trait Implementations§
impl Forget for StoredEvent
impl Freeze for StoredEventwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
PhantomData<String>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
impl Move for StoredEvent
impl RefUnwindSafe for StoredEvent
impl Send for StoredEvent
impl Sync for StoredEvent
impl Unpin for StoredEvent
impl UnsafeUnpin for StoredEventwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
impl UnwindSafe for StoredEvent
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request