Skip to main content

EventPayload

Trait EventPayload 

Source
pub trait EventPayload:
    Serialize
    + DeserializeOwned
    + JsonSchema {
    const KIND: &'static str;

    // Provided method
    fn kind() -> EventKind { ... }
}
Expand description

One typed payload declared under a kind name, by the domain that owns it.

KIND is the one authoritative source of the kind’s name: the schema marker is written from it by [event_schema_of], the store’s kind column is written from it, and the clients’ tables are generated from the marker.

Required Associated Constants§

Source

const KIND: &'static str

The name this payload’s events are written down under: lowercase snake_case, as KIND_PATTERN states.

Provided Methods§

Source

fn kind() -> EventKind

The kind this payload belongs to.

§Panics

Panics when KIND is not a kind name, which is a declaring crate’s own defect: its schema test drives this for every kind it declares, and the client generator refuses a marker outside the pattern, so a misspelt name never reaches a running system.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§