Skip to main content

Message

Trait Message 

Source
pub trait Message:
    Serialize
    + DeserializeOwned
    + Send
    + Sync
    + 'static {
    const DOMAIN: &'static str;
    const TYPE: &'static str;

    // Required method
    fn declare(domain: &Domain);
}
Expand description

A message of a domain: implemented by the attributes, not by hand.

Required Associated Constants§

Source

const DOMAIN: &'static str

The domain it belongs to.

Source

const TYPE: &'static str

Its type within the domain.

Required Methods§

Source

fn declare(domain: &Domain)

Declares its schema on domain (an event’s version, upcasts and vault fields; a command’s vault fields; a query’s target). The SDK calls it once per domain.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§