Trait chekov::Aggregate

source ·
pub trait Aggregate: Send + Clone + Default + Unpin + 'static {
    // Required method
    fn identity() -> &'static str;
}
Expand description

Define an Aggregate

We don’t recommend implementing this trait directly. use the Aggregate derive macro instead


#[derive(Debug, Clone, Default, Aggregate)]
#[aggregate(identity = "account")]
struct Account {
    account_id: Option<uuid::Uuid>
}

Required Methods§

source

fn identity() -> &'static str

Define the identity of this kind of Aggregate.

The identity is concatenated to the stream_uuid to create the stream_name of this aggregate.

Defining the identity as account will create streams account-UUID.

Implementors§