pub struct CommandEnvelope {
pub command_name: CommandName,
pub command_id: String,
pub app_id: AppId,
pub node_id: NodeId,
pub issued_at_ms: u64,
pub idempotency_key: Option<String>,
pub payload: Vec<u8>,
pub trace: Option<TraceContext>,
}Expand description
Immutable command envelope.
Fields§
§command_name: CommandNameStable command name.
command_id: StringUnique command identity.
app_id: AppIdApplication issuing the command.
node_id: NodeIdNode issuing the command.
issued_at_ms: u64Issue timestamp in Unix milliseconds.
idempotency_key: Option<String>Optional key used to deduplicate mutating commands.
payload: Vec<u8>Opaque application-owned payload.
trace: Option<TraceContext>Optional distributed trace context.
Implementations§
Source§impl CommandEnvelope
impl CommandEnvelope
Sourcepub fn new(
command_name: CommandName,
command_id: String,
app_id: AppId,
node_id: NodeId,
issued_at_ms: u64,
idempotency_key: Option<String>,
payload: Vec<u8>,
) -> RuntimeResult<Self>
pub fn new( command_name: CommandName, command_id: String, app_id: AppId, node_id: NodeId, issued_at_ms: u64, idempotency_key: Option<String>, payload: Vec<u8>, ) -> RuntimeResult<Self>
Creates and validates a command envelope.
Sourcepub fn with_trace(self, trace: TraceContext) -> Self
pub fn with_trace(self, trace: TraceContext) -> Self
Attaches distributed trace context.
Sourcepub fn command_name(&self) -> &CommandName
pub fn command_name(&self) -> &CommandName
Returns the command name.
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 (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 CommandEnvelope
impl Debug for CommandEnvelope
impl Eq for CommandEnvelope
Source§impl PartialEq for CommandEnvelope
impl PartialEq for CommandEnvelope
impl StructuralPartialEq for CommandEnvelope
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