[][src]Trait cqrs_core::SnapshotSink

pub trait SnapshotSink<A> where
    A: Aggregate
{ type Error: CqrsError; fn persist_snapshot<I>(
        &self,
        id: &I,
        aggregate: &A,
        version: Version,
        last_snapshot_version: Option<Version>
    ) -> Result<Version, Self::Error>
    where
        I: AggregateId<A>
; }

A sink for writing/persisting snapshots of aggregates.

Associated Types

type Error: CqrsError

The error type.

Loading content...

Required methods

fn persist_snapshot<I>(
    &self,
    id: &I,
    aggregate: &A,
    version: Version,
    last_snapshot_version: Option<Version>
) -> Result<Version, Self::Error> where
    I: AggregateId<A>, 

Writes an aggregate with its version to the sink. Returns the version number of the latest snapshot.

Loading content...

Implementors

Loading content...