[][src]Struct cqrs::Entity

pub struct Entity<I, A> where
    A: Aggregate,
    I: AggregateId<A>, 
{ /* fields omitted */ }

An identified, specific instance of a hydrated aggregate.

Methods

impl<I, A> Entity<I, A> where
    A: Aggregate,
    I: AggregateId<A>, 
[src]

pub fn new(id: I, aggregate: HydratedAggregate<A>) -> Self[src]

Creates a new entity from an identifier and an associated hydrated aggregate.

pub fn id(&self) -> &I[src]

The entity's identifier.

pub fn aggregate(&self) -> &HydratedAggregate<A>[src]

An immutable reference to the underlying aggregate.

pub fn aggregate_mut(&mut self) -> &mut HydratedAggregate<A>[src]

A mutable reference to the underlying aggregate.

Trait Implementations

impl<I: Clone, A: Clone> Clone for Entity<I, A> where
    A: Aggregate,
    I: AggregateId<A>, 
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<I: Default, A: Default> Default for Entity<I, A> where
    A: Aggregate,
    I: AggregateId<A>, 
[src]

impl<I: PartialEq, A: PartialEq> PartialEq<Entity<I, A>> for Entity<I, A> where
    A: Aggregate,
    I: AggregateId<A>, 
[src]

impl<I: Copy, A: Copy> Copy for Entity<I, A> where
    A: Aggregate,
    I: AggregateId<A>, 
[src]

impl<I: Eq, A: Eq> Eq for Entity<I, A> where
    A: Aggregate,
    I: AggregateId<A>, 
[src]

impl<I: Debug, A: Debug> Debug for Entity<I, A> where
    A: Aggregate,
    I: AggregateId<A>, 
[src]

impl<I: Hash, A: Hash> Hash for Entity<I, A> where
    A: Aggregate,
    I: AggregateId<A>, 
[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<I, A> Borrow<A> for Entity<I, A> where
    A: Aggregate,
    I: AggregateId<A>, 
[src]

Auto Trait Implementations

impl<I, A> Sync for Entity<I, A> where
    A: Sync,
    I: Sync

impl<I, A> Send for Entity<I, A> where
    A: Send,
    I: Send

impl<I, A> Unpin for Entity<I, A> where
    A: Unpin,
    I: Unpin

impl<I, A> RefUnwindSafe for Entity<I, A> where
    A: RefUnwindSafe,
    I: RefUnwindSafe

impl<I, A> UnwindSafe for Entity<I, A> where
    A: UnwindSafe,
    I: UnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<T, V> SliceConcat<T> for V where
    T: Clone,
    V: Borrow<[T]>, 
[src]

type Output = Vec<T>

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

The resulting type after concatenation

impl<S> SliceConcat<str> for S where
    S: Borrow<str>, 
[src]

type Output = String

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

The resulting type after concatenation

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

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

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