Struct krill::commons::eventsourcing::StoredCommand
source · pub struct StoredCommand<A: Aggregate> { /* private fields */ }
Expand description
A description of a command that was processed, and the events / or error that followed. Commands that turn out to be no-ops (no events, no errors) should not be stored.
Implementations§
source§impl<A: Aggregate> StoredCommand<A>
impl<A: Aggregate> StoredCommand<A>
pub fn new( actor: String, time: Time, handle: MyHandle, version: u64, details: A::StorableCommandDetails, effect: StoredEffect<A::Event, A::InitEvent> ) -> Self
pub fn actor(&self) -> &String
pub fn time(&self) -> Time
pub fn handle(&self) -> &MyHandle
pub fn version(&self) -> u64
pub fn details(&self) -> &A::StorableCommandDetails
pub fn effect(&self) -> &StoredEffect<A::Event, A::InitEvent>
pub fn events(&self) -> Option<&Vec<A::Event>>
pub fn into_events(self) -> Option<Vec<A::Event>>
pub fn into_init(self) -> Option<A::InitEvent>
Trait Implementations§
source§impl<A: Clone + Aggregate> Clone for StoredCommand<A>
impl<A: Clone + Aggregate> Clone for StoredCommand<A>
source§fn clone(&self) -> StoredCommand<A>
fn clone(&self) -> StoredCommand<A>
Returns a copy 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<'de, A: Aggregate> Deserialize<'de> for StoredCommand<A>
impl<'de, A: Aggregate> Deserialize<'de> for StoredCommand<A>
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
source§impl<A: Aggregate> From<StoredCommand<A>> for CommandHistoryRecord
impl<A: Aggregate> From<StoredCommand<A>> for CommandHistoryRecord
source§fn from(command: StoredCommand<A>) -> Self
fn from(command: StoredCommand<A>) -> Self
Converts to this type from the input type.
source§impl<A: PartialEq + Aggregate> PartialEq for StoredCommand<A>
impl<A: PartialEq + Aggregate> PartialEq for StoredCommand<A>
source§fn eq(&self, other: &StoredCommand<A>) -> bool
fn eq(&self, other: &StoredCommand<A>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<A: Aggregate> Serialize for StoredCommand<A>where
A::StorableCommandDetails: Serialize,
impl<A: Aggregate> Serialize for StoredCommand<A>where
A::StorableCommandDetails: Serialize,
impl<A: Eq + Aggregate> Eq for StoredCommand<A>
impl<A: Aggregate> StructuralEq for StoredCommand<A>
impl<A: Aggregate> StructuralPartialEq for StoredCommand<A>
Auto Trait Implementations§
impl<A> RefUnwindSafe for StoredCommand<A>where
<A as Aggregate>::Event: RefUnwindSafe,
<A as Aggregate>::InitEvent: RefUnwindSafe,
<A as Aggregate>::StorableCommandDetails: RefUnwindSafe,
impl<A> Send for StoredCommand<A>
impl<A> Sync for StoredCommand<A>
impl<A> Unpin for StoredCommand<A>
impl<A> UnwindSafe for StoredCommand<A>where
<A as Aggregate>::Event: UnwindSafe,
<A as Aggregate>::InitEvent: UnwindSafe,
<A as Aggregate>::StorableCommandDetails: 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Text for Twhere
T: Display,
impl<T> Text for Twhere
T: Display,
source§fn write_escaped(
&self,
mode: TextEscape,
target: &mut impl Write
) -> Result<(), Error>
fn write_escaped( &self, mode: TextEscape, target: &mut impl Write ) -> Result<(), Error>
Write text escaped for the given mode to
target
.