Struct eventually_util::optional::AsAggregate
source · [−]pub struct AsAggregate<A>(_);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
sourceimpl<A> Aggregate for AsAggregate<A> where
A: Aggregate,
A: Send + Sync,
A::Id: Send + Sync,
A::Command: Send + Sync,
A::State: Send + Sync,
impl<A> Aggregate for AsAggregate<A> where
A: Aggregate,
A: Send + Sync,
A::Id: Send + Sync,
A::Command: Send + Sync,
A::State: Send + Sync,
type Id = A::Id
type Id = A::Id
Aggregate identifier: this should represent an unique identifier to refer to a unique Aggregate instance. Read more
type State = Option<A::State>
type State = Option<A::State>
State of the Aggregate: this should represent the Domain Entity data structure.
sourceimpl<A: Clone> Clone for AsAggregate<A>
impl<A: Clone> Clone for AsAggregate<A>
sourcefn clone(&self) -> AsAggregate<A>
fn clone(&self) -> AsAggregate<A>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<A> From<A> for AsAggregate<A>
impl<A> From<A> for AsAggregate<A>
Auto Trait Implementations
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
sourceimpl<T> AggregateExt for T where
T: Aggregate,
impl<T> AggregateExt for T where
T: Aggregate,
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more