Skip to main content

AggregatorEvent

Trait AggregatorEvent 

Source
pub trait AggregatorEvent: Aggregator {
    // 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 aggregator type.

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

§Example

#[evento::aggregator("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", so this trait is not object safe.

Implementors§