[−][src]Struct eventually::AggregateRoot
An AggregateRoot represents an handler to the Aggregate it's managing,
such as:
- Owning its
State,Idand version, - Proxying
Commands to theAggregateusing the currentState, - Keeping a list of
Events to commit afterCommandexecution.
Initialize
An AggregateRoot can only be initialized using the AggregateRootBuilder.
Check AggregateRootBuilder::build for more information.
Implementations
impl<T> AggregateRoot<T> where
T: Aggregate + Clone, [src]
T: Aggregate + Clone,
pub fn id(&self) -> &<T as Aggregate>::Id[src]
Returns a reference to the Aggregate Id that represents
the entity wrapped by this AggregateRoot instance.
pub fn state(&self) -> &<T as Aggregate>::State[src]
Returns a reference to the current Aggregate State.
impl<T> AggregateRoot<T> where
T: Aggregate + Clone,
<T as Aggregate>::Event: Clone,
<T as Aggregate>::State: Clone, [src]
T: Aggregate + Clone,
<T as Aggregate>::Event: Clone,
<T as Aggregate>::State: Clone,
pub async fn handle(
&'_ mut self,
command: <T as Aggregate>::Command
) -> Result<&'_ mut AggregateRoot<T>, <T as Aggregate>::Error>[src]
&'_ mut self,
command: <T as Aggregate>::Command
) -> Result<&'_ mut AggregateRoot<T>, <T as Aggregate>::Error>
Handles the submitted Command using the Aggregate::handle method
and updates the Aggregate State.
Returns a &mut self reference to allow for method chaining.
Trait Implementations
impl<T> Debug for AggregateRoot<T> where
T: Debug + Aggregate + Clone + 'static,
<T as Aggregate>::Id: Debug,
<T as Aggregate>::State: Debug,
<T as Aggregate>::Event: Debug, [src]
T: Debug + Aggregate + Clone + 'static,
<T as Aggregate>::Id: Debug,
<T as Aggregate>::State: Debug,
<T as Aggregate>::Event: Debug,
impl<T> PartialEq<AggregateRoot<T>> for AggregateRoot<T> where
T: Aggregate + Clone, [src]
T: Aggregate + Clone,
fn eq(&self, other: &AggregateRoot<T>) -> bool[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool1.0.0[src]
impl<T> Serialize for AggregateRoot<T> where
T: Aggregate + Clone + 'static,
<T as Aggregate>::Id: Serialize,
<T as Aggregate>::State: Serialize, [src]
T: Aggregate + Clone + 'static,
<T as Aggregate>::Id: Serialize,
<T as Aggregate>::State: Serialize,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer, [src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl<T> Versioned for AggregateRoot<T> where
T: Aggregate + Clone, [src]
T: Aggregate + Clone,
Auto Trait Implementations
impl<T> RefUnwindSafe for AggregateRoot<T> where
T: RefUnwindSafe,
<T as Aggregate>::Event: RefUnwindSafe,
<T as Aggregate>::Id: RefUnwindSafe,
<T as Aggregate>::State: RefUnwindSafe,
T: RefUnwindSafe,
<T as Aggregate>::Event: RefUnwindSafe,
<T as Aggregate>::Id: RefUnwindSafe,
<T as Aggregate>::State: RefUnwindSafe,
impl<T> Send for AggregateRoot<T> where
T: Send,
<T as Aggregate>::Event: Send,
<T as Aggregate>::Id: Send,
<T as Aggregate>::State: Send,
T: Send,
<T as Aggregate>::Event: Send,
<T as Aggregate>::Id: Send,
<T as Aggregate>::State: Send,
impl<T> Sync for AggregateRoot<T> where
T: Sync,
<T as Aggregate>::Event: Sync,
<T as Aggregate>::Id: Sync,
<T as Aggregate>::State: Sync,
T: Sync,
<T as Aggregate>::Event: Sync,
<T as Aggregate>::Id: Sync,
<T as Aggregate>::State: Sync,
impl<T> Unpin for AggregateRoot<T> where
T: Unpin,
<T as Aggregate>::Event: Unpin,
<T as Aggregate>::Id: Unpin,
<T as Aggregate>::State: Unpin,
T: Unpin,
<T as Aggregate>::Event: Unpin,
<T as Aggregate>::Id: Unpin,
<T as Aggregate>::State: Unpin,
impl<T> UnwindSafe for AggregateRoot<T> where
T: UnwindSafe,
<T as Aggregate>::Event: UnwindSafe,
<T as Aggregate>::Id: UnwindSafe,
<T as Aggregate>::State: UnwindSafe,
T: UnwindSafe,
<T as Aggregate>::Event: UnwindSafe,
<T as Aggregate>::Id: UnwindSafe,
<T as Aggregate>::State: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,