Skip to content

Commit

Permalink
Merge pull request #13 from vincentdephily/hash_trait
Browse files Browse the repository at this point in the history
Implement Hash for PacketIdentifier.
  • Loading branch information
00imvj00 authored Oct 17, 2019
2 parents a561b75 + 2952613 commit 86b064d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use bytes::{Buf, BytesMut, IntoBuf};
use std::io;

#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
/// Packet Identifier, for ack purposes.
///
/// Note that the spec disallows a pid of 0 ([MQTT-2.3.1-1] for mqtt3, [MQTT-2.2.1-3] for mqtt5).
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PacketIdentifier(pub u16);

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
Expand Down

0 comments on commit 86b064d

Please sign in to comment.