[][src]Struct eventually::AggregateRoot

pub struct AggregateRoot<T> where
    T: Aggregate + 'static, 
{ /* fields omitted */ }

An AggregateRoot represents an handler to the Aggregate it's managing, such as:

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]

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]

pub async fn handle(
    &'_ mut self,
    command: <T as Aggregate>::Command
) -> Result<&'_ mut AggregateRoot<T>, <T as Aggregate>::Error>
[src]

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]

impl<T> Deref for AggregateRoot<T> where
    T: Aggregate
[src]

type Target = <T as Aggregate>::State

The resulting type after dereferencing.

impl<T> PartialEq<AggregateRoot<T>> for AggregateRoot<T> where
    T: Aggregate
[src]

impl<T> Versioned for AggregateRoot<T> where
    T: Aggregate
[src]

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

impl<T> Send for AggregateRoot<T> where
    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

impl<T> Unpin for AggregateRoot<T> where
    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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.