pub struct AsAggregate<A>(_);
Expand description

Newtype pattern to ensure compatibility between optional::Aggregate trait and the core Aggregate trait.

Usage

  1. Use From<Aggregate> trait implementation:
    use eventually_util::optional::AsAggregate;
    
    let aggregate = AsAggregate::from(MyOptionalAggregate);
  2. Use the Aggregate::as_aggregate method:
    let aggregate = MyOptionalAggregate.as_aggregate();

Trait Implementations

Aggregate identifier: this should represent an unique identifier to refer to a unique Aggregate instance. Read more

State of the Aggregate: this should represent the Domain Entity data structure.

Represents a specific, domain-related change to the Aggregate State. Read more

Commands are all the possible operations available on an Aggregate. Use Commands to model business use-cases or State mutations. Read more

Possible failures while applying Events or handling Commands. Read more

Applies an Event to the current Aggregate State. Read more

Handles the requested Command and returns a list of Events to apply the State mutation based on the current representation of the State. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Applies a list of Events from an Iterator to the current Aggregate State. Read more

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.