Skip to main content

Message

Trait Message 

Source
pub trait Message: Serialize + DeserializeOwned {
    const TYPE: &'static str;
    const VERSION: u16;
}
Expand description

A type that can be built into an Envelope and persisted or published.

TYPE/VERSION are stable application contracts: they identify a message across serialization, storage and the wire, and are never derived from std::any::type_name::<T>() or a module path — renaming or moving the Rust type SHALL NOT orphan a pending row or a message already in flight (ADR 0010).

Required Associated Constants§

Source

const TYPE: &'static str

The message’s name, e.g. "orders.created". Stable once anything has published it.

Source

const VERSION: u16

The message’s version. Bump when the wire shape changes incompatibly.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§