pub struct CommandEnvelope<C> {
pub command_id: CommandId,
pub turn_id: TurnId,
pub actor: ActorContext,
pub case_ref: CaseRef,
pub idempotency_key: IdempotencyKey,
pub origin: CommandOrigin,
pub command: C,
}Expand description
A typed command with everything the executor and the journal need (spec §14.2).
Fields§
§command_id: CommandIdIdentifier of this envelope.
turn_id: TurnIdTurn that produced it.
actor: ActorContextActor on whose behalf it runs.
case_ref: CaseRefTarget case and expected revision.
idempotency_key: IdempotencyKeyIdempotency key (I14).
origin: CommandOriginAuthorizing origin.
command: CThe domain command.
Implementations§
Source§impl<C> CommandEnvelope<C>
impl<C> CommandEnvelope<C>
Sourcepub fn account_id(&self) -> &AccountId
pub fn account_id(&self) -> &AccountId
Account the command runs in.
Sourcepub fn try_map_command<D, E>(
self,
f: impl FnOnce(C) -> Result<D, E>,
) -> Result<CommandEnvelope<D>, E>
pub fn try_map_command<D, E>( self, f: impl FnOnce(C) -> Result<D, E>, ) -> Result<CommandEnvelope<D>, E>
Transforms the command payload, keeping every other field.
Trait Implementations§
Source§impl<C: Clone> Clone for CommandEnvelope<C>
impl<C: Clone> Clone for CommandEnvelope<C>
Source§impl<C: Debug> Debug for CommandEnvelope<C>
impl<C: Debug> Debug for CommandEnvelope<C>
Source§impl<'de, C> Deserialize<'de> for CommandEnvelope<C>where
C: Deserialize<'de>,
impl<'de, C> Deserialize<'de> for CommandEnvelope<C>where
C: Deserialize<'de>,
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
impl<C: Eq> Eq for CommandEnvelope<C>
Source§impl<C: PartialEq> PartialEq for CommandEnvelope<C>
impl<C: PartialEq> PartialEq for CommandEnvelope<C>
Source§impl<C> Serialize for CommandEnvelope<C>where
C: Serialize,
impl<C> Serialize for CommandEnvelope<C>where
C: Serialize,
impl<C: PartialEq> StructuralPartialEq for CommandEnvelope<C>
Auto Trait Implementations§
impl<C> Freeze for CommandEnvelope<C>where
C: Freeze,
impl<C> RefUnwindSafe for CommandEnvelope<C>where
C: RefUnwindSafe,
impl<C> Send for CommandEnvelope<C>where
C: Send,
impl<C> Sync for CommandEnvelope<C>where
C: Sync,
impl<C> Unpin for CommandEnvelope<C>where
C: Unpin,
impl<C> UnsafeUnpin for CommandEnvelope<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for CommandEnvelope<C>where
C: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.