macro_rules! topic {
($tyname:ident, $msg:ty) => { ... };
($tyname:ident, $msg:ty, $path:expr,) => { ... };
($tyname:ident, $msg:ty, $path:expr) => { ... };
}
Expand description
ยงTopic macro
Used to define a single Topic marker type that implements the Topic trait.
Prefer the topics!()
macro macro instead.
use postcard_rpc::topic;
#[derive(Debug, Serialize, Deserialize, Schema)]
pub struct Message1 {
a: u8,
b: u64,
}
topic!(Topic1, Message1, "topic/1");
If the path is omitted, the type name is used instead.