pub struct Command<TPayload>where
TPayload: BasePayload,{
pub command_type: String,
pub aggregate_id: String,
pub payload: TPayload,
pub timestamp: i64,
pub metadata: HashMap<String, String>,
}Fields§
§command_type: String§aggregate_id: String§payload: TPayload§timestamp: i64§metadata: HashMap<String, String>Implementations§
Source§impl<TPayload> Command<TPayload>
impl<TPayload> Command<TPayload>
pub fn create(aggregate_id: String, payload: TPayload) -> Self
pub fn add_to_metadata(&mut self, key: String, value: String)
pub fn set_correlation_id(&mut self, correlation_id: String)
pub fn set_causation_id(&mut self, causation_id: String)
Trait Implementations§
Source§impl<'de, TPayload> Deserialize<'de> for Command<TPayload>where
TPayload: BasePayload + Deserialize<'de>,
impl<'de, TPayload> Deserialize<'de> for Command<TPayload>where
TPayload: BasePayload + 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<TPayload> StructuralPartialEq for Command<TPayload>where
TPayload: BasePayload + PartialEq,
Auto Trait Implementations§
impl<TPayload> Freeze for Command<TPayload>where
TPayload: Freeze,
impl<TPayload> RefUnwindSafe for Command<TPayload>where
TPayload: RefUnwindSafe,
impl<TPayload> Send for Command<TPayload>
impl<TPayload> Sync for Command<TPayload>
impl<TPayload> Unpin for Command<TPayload>where
TPayload: Unpin,
impl<TPayload> UnsafeUnpin for Command<TPayload>where
TPayload: UnsafeUnpin,
impl<TPayload> UnwindSafe for Command<TPayload>where
TPayload: UnwindSafe,
Blanket Implementations§
impl<T> BasePayload for T
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