Trait Topic

Source
pub trait Topic {
    type Message: Schema + ?Sized;

    const PATH: &'static str;
    const TOPIC_KEY: Key;
    const TOPIC_KEY4: Key4 = _;
    const TOPIC_KEY2: Key2 = _;
    const TOPIC_KEY1: Key1 = _;
}
Expand description

A marker trait denoting a single topic

Unlike Endpoints, Topics are unidirectional, and can be sent at any time asynchronously. Messages may be sent client to server, or server to client.

Typically used with the topic macro.

Required Associated Constants§

Source

const PATH: &'static str

The path associated with this Topic

Source

const TOPIC_KEY: Key

The unique Key identifying the Message

Provided Associated Constants§

Source

const TOPIC_KEY4: Key4 = _

The unique Key4 identifying the Message

Source

const TOPIC_KEY2: Key2 = _

The unique Key2 identifying the Message

Source

const TOPIC_KEY1: Key1 = _

The unique Key2 identifying the Message

Required Associated Types§

Source

type Message: Schema + ?Sized

The type of the Message (unidirectional)

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§

Source§

impl Topic for GetAllSchemaDataTopic

Source§

const PATH: &'static str = "postcard-rpc/schema/data"

Source§

const TOPIC_KEY: Key

Source§

type Message = OwnedSchemaData

Source§

impl Topic for LoggingTopic

Source§

const PATH: &'static str = "postcard-rpc/logging"

Source§

const TOPIC_KEY: Key

Source§

type Message = String