summaryrefslogtreecommitdiffstats
path: root/crates/core/tedge_api/src/message.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/core/tedge_api/src/message.rs')
-rw-r--r--crates/core/tedge_api/src/message.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/core/tedge_api/src/message.rs b/crates/core/tedge_api/src/message.rs
index bbcda857..f7beb94c 100644
--- a/crates/core/tedge_api/src/message.rs
+++ b/crates/core/tedge_api/src/message.rs
@@ -141,6 +141,15 @@ impl MessageType {
pub fn name(&self) -> &'static str {
self.name
}
+
+ /// Check whether the UUID of this MessageType is the same as of the other MessageType
+ #[must_use]
+ pub fn eq_uuid(&self, other: &Self) -> bool {
+ match (&self.kind, &other.kind) {
+ (MessageKind::Typed(uuid_a), MessageKind::Typed(uuid_b)) => uuid_a == uuid_b,
+ _ => false,
+ }
+ }
}
/// A message to tell the core to stop thin-edge