Skip to main content

AggregateEvent

Trait AggregateEvent 

Source
pub trait AggregateEvent: Aggregate {
    // Required method
    fn event_name() -> &'static str;
}
Expand description

Trait for event types.

Events represent state changes that have occurred. Each event type has a name and belongs to an aggregate type.

This trait is typically derived using the #[evento::aggregate] macro.

§Example

#[evento::aggregate("myapp/Account")]
#[derive(bitcode::Encode, bitcode::Decode)]
pub struct AccountOpened {
    pub owner: String,
}

Required Methods§

Source

fn event_name() -> &'static str

Returns the event name (e.g., “AccountOpened”)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§