Struct cqrs_eventsourcing::FormatedEvent[][src]

pub struct FormatedEvent<A, E> where
    A: Aggregate,
    E: DomainEvent<A>, 
{ pub aggregate_id: String, pub aggregate_type: String, pub version: usize, pub payload: E, pub meta: MetaData, pub created_at: String, // some fields omitted }

Fields

aggregate_id: Stringaggregate_type: Stringversion: usizepayload: Emeta: MetaDatacreated_at: String

Implementations

impl<A, E> FormatedEvent<A, E> where
    A: Aggregate,
    E: DomainEvent<A>, 
[src]

pub fn new(
    aggregate_id: String,
    aggregate_type: String,
    version: usize,
    payload: E,
    meta: MetaData,
    created_at: Option<&str>
) -> FormatedEvent<A, E>
[src]

Create a new FormatedEvent

pub fn create_many(
    aggregate_id: &str,
    current_version: usize,
    events: Vec<E>,
    meta: MetaData
) -> FormatedEvents<A, E>
[src]

Create FormatedEvents from DomainEvents

Trait Implementations

impl<A, E> Clone for FormatedEvent<A, E> where
    A: Aggregate,
    E: DomainEvent<A>, 
[src]

impl<A: Debug, E: Debug> Debug for FormatedEvent<A, E> where
    A: Aggregate,
    E: DomainEvent<A>, 
[src]

impl<A, E> Serialize for FormatedEvent<A, E> where
    A: Aggregate,
    E: DomainEvent<A>,
    E: Serialize
[src]

Auto Trait Implementations

impl<A, E> RefUnwindSafe for FormatedEvent<A, E> where
    A: RefUnwindSafe,
    E: RefUnwindSafe

impl<A, E> Send for FormatedEvent<A, E>

impl<A, E> Sync for FormatedEvent<A, E>

impl<A, E> Unpin for FormatedEvent<A, E> where
    A: Unpin,
    E: Unpin

impl<A, E> UnwindSafe for FormatedEvent<A, E> where
    A: UnwindSafe,
    E: 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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.