pub struct CommandEnvelope {
pub aggregate_type: String,
pub instance_id: String,
pub command: Value,
pub context: CommandContext,
}Expand description
A type-erased command envelope for cross-aggregate dispatch.
Produced by process managers when reacting to events. The command field
is a serde_json::Value because the process manager does not know the
concrete command type of the target aggregate at compile time. The
dispatch layer deserializes it into the correct A::Command at runtime.
§Fields
aggregate_type- Target aggregate type name (must matchAggregate::AGGREGATE_TYPE).instance_id- Target aggregate instance identifier.command- JSON-serialized command payload.context- Cross-cutting metadata forwarded to the command handler.
Fields§
§aggregate_type: StringTarget aggregate type name (must match Aggregate::AGGREGATE_TYPE).
instance_id: StringTarget aggregate instance identifier.
command: ValueJSON-serialized command payload.
context: CommandContextCross-cutting metadata forwarded to the command handler.
Trait Implementations§
Source§impl Clone for CommandEnvelope
impl Clone for CommandEnvelope
Source§fn clone(&self) -> CommandEnvelope
fn clone(&self) -> CommandEnvelope
Returns a duplicate of the value. Read more
1.0.0 · 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 CommandEnvelope
impl Debug for CommandEnvelope
Source§impl<'de> Deserialize<'de> for CommandEnvelope
impl<'de> Deserialize<'de> for CommandEnvelope
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 CommandEnvelope
impl RefUnwindSafe for CommandEnvelope
impl Send for CommandEnvelope
impl Sync for CommandEnvelope
impl Unpin for CommandEnvelope
impl UnsafeUnpin for CommandEnvelope
impl UnwindSafe for CommandEnvelope
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