| Crates.io | caryatid_module_playback |
| lib.rs | caryatid_module_playback |
| version | 0.9.0 |
| created_at | 2025-05-15 13:01:18.156524+00 |
| updated_at | 2025-06-18 15:02:33.112276+00 |
| description | Message playback module for Caryatid |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1674941 |
| size | 40,345 |
The Playback module provides a way to playback any messages on the bus. It reads messages from a directory of JSON files and publishes them to a given topic.
The Playback module is configured with a topic to publish to, and a directory from which to read message files:
[module.playback]
topic = "interesting.message.channel"
path = "/path/to/playback/from/"
The playback module can read any message type using their serde::Deserialize
trait.
The Playback module needs to be parameterised with the type of the outer
message enum
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub enum Message {
None(()),
... all my messages ...
}
Then within your main.rs you would register the Playback module into the
process like this:
Playback::<Message>::register(&mut process);