[−][src]Struct eventually::AggregateRoot
An AggregateRoot
represents an handler to the Aggregate
it's managing,
such as:
- Owning its
State
,Id
and version, - Proxying
Command
s to theAggregate
using the currentState
, - Keeping a list of
Event
s to commit afterCommand
execution.
Initialize
An AggregateRoot
can only be initialized using the AggregateRootBuilder
.
Check AggregateRootBuilder::build
for more information.
Implementations
impl<T> AggregateRoot<T> where
T: Aggregate,
[src]
T: Aggregate,
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,
<T as Aggregate>::Event: Clone,
<T as Aggregate>::State: Clone,
<T as Aggregate>::Command: Debug,
[src]
T: Aggregate,
<T as Aggregate>::Event: Clone,
<T as Aggregate>::State: Clone,
<T as Aggregate>::Command: Debug,
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 + 'static,
<T as Aggregate>::Id: Debug,
<T as Aggregate>::State: Debug,
<T as Aggregate>::Event: Debug,
[src]
T: Debug + Aggregate + 'static,
<T as Aggregate>::Id: Debug,
<T as Aggregate>::State: Debug,
<T as Aggregate>::Event: Debug,
impl<T> Deref for AggregateRoot<T> where
T: Aggregate,
[src]
T: Aggregate,
type Target = <T as Aggregate>::State
The resulting type after dereferencing.
fn deref(&self) -> &<AggregateRoot<T> as Deref>::Target
[src]
impl<T> PartialEq<AggregateRoot<T>> for AggregateRoot<T> where
T: Aggregate,
[src]
T: Aggregate,
fn eq(&self, other: &AggregateRoot<T>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T> Versioned for AggregateRoot<T> where
T: Aggregate,
[src]
T: Aggregate,
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>,