Crates.io | sparkplug-rs |
lib.rs | sparkplug-rs |
version | 0.4.0 |
source | src |
created_at | 2022-03-12 13:12:04.808009 |
updated_at | 2022-05-13 18:31:07.894803 |
description | Sparkplug protobuf bindings for Rust |
homepage | https://docs.rs/sparkplug-rs/ |
repository | https://github.com/ahlner/sparkplug-rs |
max_upload_size | |
id | 548756 |
size | 54,316 |
Rust protobuf payload for Sparkplug™.
The structs are generated with the protobuf IDL of the Eclipse Tahu
project. For more information
look at the homepage of the Eclipse Sparkplug project
.
This crate provides a convenient way to handle MQTT topic names with TopicName.
# use std::str::FromStr;
# use sparkplug_rs::{NodeMessageType, TopicName, TopicNamespace};
let node = TopicName::new_node_message(TopicNamespace::SPBV1_0,
"my_group".to_string(),
NodeMessageType::NBIRTH,
"nodeId".to_string());
assert_eq!(node.to_string(), "spBv1.0/my_group/NBIRTH/nodeId");
let topic: TopicName = TopicName::from_str("spBv1.0/my_group/NBIRTH/nodeId").unwrap();
assert_eq!(topic, node);
License: EPL-2.0