pub struct OperationEventEnvelope { /* private fields */ }Expand description
Common envelope for operation lifecycle events.
Implementations§
Source§impl OperationEventEnvelope
impl OperationEventEnvelope
Sourcepub fn new(
occurred_at: Timestamp,
operation_id: OperationId,
operation: OperationName,
correlation_id: CorrelationId,
producer: ProducerRef,
payload: OperationEventPayload,
) -> Self
pub fn new( occurred_at: Timestamp, operation_id: OperationId, operation: OperationName, correlation_id: CorrelationId, producer: ProducerRef, payload: OperationEventPayload, ) -> Self
Creates a version-one event envelope and derives its event type from the payload.
Sourcepub fn with_causation_id(self, causation_id: OperationId) -> Self
pub fn with_causation_id(self, causation_id: OperationId) -> Self
Records the operation that caused this event’s operation.
Sourcepub fn with_actor(self, actor: ActorRef) -> Self
pub fn with_actor(self, actor: ActorRef) -> Self
Records the actor when known.
Sourcepub fn with_target(self, target: TargetRef) -> Self
pub fn with_target(self, target: TargetRef) -> Self
Records the resolved target when known.
Sourcepub fn with_trace(self, trace: TraceContext) -> Self
pub fn with_trace(self, trace: TraceContext) -> Self
Adds trace context.
Sourcepub fn with_redaction(self, redaction: RedactionMetadata) -> Self
pub fn with_redaction(self, redaction: RedactionMetadata) -> Self
Adds redaction metadata.
Sourcepub fn validate(&self) -> Result<(), EventError>
pub fn validate(&self) -> Result<(), EventError>
Validates envelope, payload, target, and terminal-status consistency.
Sourcepub const fn event_version(&self) -> u32
pub const fn event_version(&self) -> u32
Returns the schema version.
Sourcepub const fn event_type(&self) -> OperationEventType
pub const fn event_type(&self) -> OperationEventType
Returns the lifecycle event type.
Sourcepub const fn occurred_at(&self) -> Timestamp
pub const fn occurred_at(&self) -> Timestamp
Returns event occurrence time.
Sourcepub fn operation_id(&self) -> &OperationId
pub fn operation_id(&self) -> &OperationId
Returns operation execution identity.
Sourcepub fn operation(&self) -> &OperationName
pub fn operation(&self) -> &OperationName
Returns canonical operation name.
Sourcepub fn correlation_id(&self) -> &CorrelationId
pub fn correlation_id(&self) -> &CorrelationId
Returns workflow correlation identity.
Sourcepub fn producer(&self) -> &ProducerRef
pub fn producer(&self) -> &ProducerRef
Returns producing component identity.
Sourcepub fn payload(&self) -> &OperationEventPayload
pub fn payload(&self) -> &OperationEventPayload
Returns lifecycle payload.
Sourcepub fn redaction(&self) -> &RedactionMetadata
pub fn redaction(&self) -> &RedactionMetadata
Returns redaction metadata.
Trait Implementations§
Source§impl Clone for OperationEventEnvelope
impl Clone for OperationEventEnvelope
Source§fn clone(&self) -> OperationEventEnvelope
fn clone(&self) -> OperationEventEnvelope
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 moreSource§impl Debug for OperationEventEnvelope
impl Debug for OperationEventEnvelope
Source§impl<'de> Deserialize<'de> for OperationEventEnvelope
impl<'de> Deserialize<'de> for OperationEventEnvelope
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
Source§impl JsonSchema for OperationEventEnvelope
impl JsonSchema for OperationEventEnvelope
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for OperationEventEnvelope
impl PartialEq for OperationEventEnvelope
Source§fn eq(&self, other: &OperationEventEnvelope) -> bool
fn eq(&self, other: &OperationEventEnvelope) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for OperationEventEnvelope
impl Serialize for OperationEventEnvelope
impl StructuralPartialEq for OperationEventEnvelope
Auto Trait Implementations§
impl Freeze for OperationEventEnvelope
impl RefUnwindSafe for OperationEventEnvelope
impl Send for OperationEventEnvelope
impl Sync for OperationEventEnvelope
impl Unpin for OperationEventEnvelope
impl UnsafeUnpin for OperationEventEnvelope
impl UnwindSafe for OperationEventEnvelope
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