mecha10-nodes-speaker 0.6.5
“Example speaker node for the Mecha10 robotics framework”
Basename is uppercase README.mdCaret or XOR expression text
SHA-256c887702cfac3a480fd65f0e6e032bdbe6f0c94f08340f7e43690f5477a1234bb
MaleculeH₂(CmDb₂)Md(Pa)
Evidence
3:41… strate pub/sub messaging.
4
5mod config;
6
7pub use config::SpeakerConfig;
8use mecha10_core::prelude::*;
9use mecha10_core::topics::Topic;
10
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct Greeting {
13 pub message: String,
14 pub count: u64,
15}
16
17impl Message for Greeting {}
18
19pub const GREETINGS_TOPIC: Topic<Greeting> = Topic::new("/example/greetings");
20
21/// Example speaker node that publishes greetings
22#[derive(Debug, Node)]
23#[node(name = "speaker")]
24pub struct SpeakerNode {
25 …
45:23… self, ctx: &Context) -> Result<()> {
46 let mut interval = tokio::time::interval(tokio::time::Duration::from_secs(self.config.interval_secs));
47
48 info!("Speaker running");
⋯8 lines
1//! Speaker node configuration
2
3use mecha10_core::prelude::*;
4
5/// Speaker node configuration
6#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
7#[ …
32:19… : default_message_prefix(),
33 topics: Topics::default(),
34});
35
36#[cfg(test)]
37mod tests {
38 use super::*;
39
40 #[test]
41 fn test_deserialize_rejects_unknown_field() {
42 let json = r#"{"intervalsecs": 5}"#;
43 let err = serde_json::fr …
57:25… cs": 5,
58 "topics": {
59 "publishes": [{ "output": "/speaker/greeting" }],
60 "subscribes": []
61 }
62 }"#;
63 let config: SpeakerConfig = serde_jso …
No evidence locations were recorded for this file. Raw result