Skip to main content

MessageKind

Trait MessageKind 

Source
pub trait MessageKind {
    type Payload: Streamable;

    const TYPE_ID: MessageType;
}
Expand description

The compile-time contract a message type declares to plug into the registry (SPEC §4). A downstream crate implements it for each of its payload types; dig-message never depends on that crate.

The Payload is a Chia-Streamable type so its bytes are byte- deterministic across the Rust and wasm/JS targets (SPEC §1); TYPE_ID is the reserved id from the owning subsystem’s band (MessageBand).

Required Associated Constants§

Source

const TYPE_ID: MessageType

The reserved MessageType id for this kind (from the subsystem’s band, SPEC §4).

Required Associated Types§

Source

type Payload: Streamable

The typed, byte-deterministic payload carried by this message type (SPEC §1, §4).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§