summaryrefslogtreecommitdiffstats
path: root/mqtt-tester/src/packet_invariant.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2023-01-05 10:30:16 +0100
committerMatthias Beyer <mail@beyermatthias.de>2023-01-11 08:57:01 +0100
commit8517254709665649b52d066c70f4d008749aa646 (patch)
tree0d80db87e5da3291b31fa4b46099fe0f9a9ec510 /mqtt-tester/src/packet_invariant.rs
parent99a58d4e98f21a7966ae7aa358260bbed6c61422 (diff)
Add PacketInvariant interface
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'mqtt-tester/src/packet_invariant.rs')
-rw-r--r--mqtt-tester/src/packet_invariant.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/mqtt-tester/src/packet_invariant.rs b/mqtt-tester/src/packet_invariant.rs
new file mode 100644
index 0000000..ad2a3bc
--- /dev/null
+++ b/mqtt-tester/src/packet_invariant.rs
@@ -0,0 +1,13 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
+use mqtt_format::v3::packet::MPacket;
+
+use crate::report::Report;
+
+pub trait PacketInvariant {
+ fn test_invariant(&self, packet: &MPacket<'_>) -> miette::Result<Report>;
+}