pub struct CommandContext {
pub actor: ActorRef,
pub idempotency_key: Option<String>,
pub metadata: BTreeMap<String, String>,
}Expand description
Metadata attached to a command for audit and observation.
Fields§
§actor: ActorRefActor responsible for the command.
idempotency_key: Option<String>Optional idempotency key supplied by the application.
metadata: BTreeMap<String, String>Opaque application context.
Implementations§
Source§impl CommandContext
impl CommandContext
Sourcepub fn with_idempotency_key(self, key: impl Into<String>) -> Self
pub fn with_idempotency_key(self, key: impl Into<String>) -> Self
Adds an idempotency key.
Trait Implementations§
Source§impl Clone for CommandContext
impl Clone for CommandContext
Source§fn clone(&self) -> CommandContext
fn clone(&self) -> CommandContext
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 CommandContext
impl Debug for CommandContext
Source§impl<'de> Deserialize<'de> for CommandContext
impl<'de> Deserialize<'de> for CommandContext
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 Eq for CommandContext
Source§impl PartialEq for CommandContext
impl PartialEq for CommandContext
Source§fn eq(&self, other: &CommandContext) -> bool
fn eq(&self, other: &CommandContext) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CommandContext
impl Serialize for CommandContext
impl StructuralPartialEq for CommandContext
Auto Trait Implementations§
impl Freeze for CommandContext
impl RefUnwindSafe for CommandContext
impl Send for CommandContext
impl Sync for CommandContext
impl Unpin for CommandContext
impl UnsafeUnpin for CommandContext
impl UnwindSafe for CommandContext
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