pub struct EntityEvent {
pub entity_type: String,
pub entity_id: String,
pub operation: String,
pub data: Value,
pub old_data: Option<Value>,
pub tenant_id: Option<String>,
pub change_spine: Option<ChangeSpineEnvelope>,
}Expand description
A simple event that EventBridge receives from ChangeLogListener
Fields§
§entity_type: StringEntity type (e.g., “Order”, “User”)
entity_id: StringEntity ID (primary key)
operation: StringOperation type (“INSERT”, “UPDATE”, “DELETE”)
data: ValueEntity data as JSON
old_data: Option<Value>Optional old data (for UPDATE operations)
tenant_id: Option<String>Tenant identifier for multi-tenant filtering (fk_customer_org).
change_spine: Option<ChangeSpineEnvelope>Change-Spine envelope metadata for client delivery (#425). Propagated
through to the SubscriptionEvent and emitted in the next payload’s
extensions.changeSpine; not used for filtering.
Implementations§
Source§impl EntityEvent
impl EntityEvent
Sourcepub fn new(
entity_type: impl Into<String>,
entity_id: impl Into<String>,
operation: impl Into<String>,
data: Value,
) -> Self
pub fn new( entity_type: impl Into<String>, entity_id: impl Into<String>, operation: impl Into<String>, data: Value, ) -> Self
Create a new entity event
Sourcepub fn with_old_data(self, old_data: Value) -> Self
pub fn with_old_data(self, old_data: Value) -> Self
Add old data for UPDATE operations
Sourcepub fn with_tenant_id(self, tenant_id: impl Into<String>) -> Self
pub fn with_tenant_id(self, tenant_id: impl Into<String>) -> Self
Set tenant identifier for multi-tenant filtering.
Sourcepub fn with_change_spine(self, envelope: ChangeSpineEnvelope) -> Self
pub fn with_change_spine(self, envelope: ChangeSpineEnvelope) -> Self
Attach the Change-Spine envelope for client delivery (#425).
Trait Implementations§
Source§impl Clone for EntityEvent
impl Clone for EntityEvent
Source§fn clone(&self) -> EntityEvent
fn clone(&self) -> EntityEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EntityEvent
impl RefUnwindSafe for EntityEvent
impl Send for EntityEvent
impl Sync for EntityEvent
impl Unpin for EntityEvent
impl UnsafeUnpin for EntityEvent
impl UnwindSafe for EntityEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more