pub struct AsAggregate<A>(/* private fields */);Expand description
Newtype pattern to ensure compatibility between optional::Aggregate trait
and the core Aggregate trait.
§Usage
- Use
From<Aggregate>trait implementation:use eventually_util::optional::AsAggregate; let aggregate = AsAggregate::from(MyOptionalAggregate); - Use the
Aggregate::as_aggregatemethod:let aggregate = MyOptionalAggregate.as_aggregate();
Trait Implementations§
Source§impl<A> Aggregate for AsAggregate<A>
impl<A> Aggregate for AsAggregate<A>
Source§type Id = <A as Aggregate>::Id
type Id = <A as Aggregate>::Id
Aggregate identifier: this should represent an unique identifier to refer
to a unique Aggregate instance.
Source§type State = Option<<A as Aggregate>::State>
type State = Option<<A as Aggregate>::State>
State of the Aggregate: this should represent the Domain Entity data structure.
Source§type Event = <A as Aggregate>::Event
type Event = <A as Aggregate>::Event
Represents a specific, domain-related change to the Aggregate
State.Source§type Command = <A as Aggregate>::Command
type Command = <A as Aggregate>::Command
Commands are all the possible operations available on an Aggregate.
Use Commands to model business use-cases or
State mutations.Source§impl<A: Clone> Clone for AsAggregate<A>
impl<A: Clone> Clone for AsAggregate<A>
Source§fn clone(&self) -> AsAggregate<A>
fn clone(&self) -> AsAggregate<A>
Returns a duplicate 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 moreAuto Trait Implementations§
impl<A> Freeze for AsAggregate<A>where
A: Freeze,
impl<A> RefUnwindSafe for AsAggregate<A>where
A: RefUnwindSafe,
impl<A> Send for AsAggregate<A>where
A: Send,
impl<A> Sync for AsAggregate<A>where
A: Sync,
impl<A> Unpin for AsAggregate<A>where
A: Unpin,
impl<A> UnwindSafe for AsAggregate<A>where
A: UnwindSafe,
Blanket Implementations§
Source§impl<T> AggregateExt for Twhere
T: Aggregate,
impl<T> AggregateExt for Twhere
T: Aggregate,
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