Skip to content

Commit

Permalink
feat: add Ord to key, ether
Browse files Browse the repository at this point in the history
  • Loading branch information
SkuldNorniern committed Oct 4, 2024
1 parent 6f11a6c commit 9a2d9c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/net/types/ether.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)]
pub struct MacAddress(pub [u8; 6]);

impl MacAddress {
Expand All @@ -14,7 +14,7 @@ impl From<&[u8]> for MacAddress {
}
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)]
pub enum EtherProtocol {
Ipv4,
Ipv6,
Expand Down
2 changes: 1 addition & 1 deletion src/net/types/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::net::IpAddr;

use crate::net::types::MacAddress;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)]
pub struct Key {
pub src_ip: IpAddr,
pub src_port: u16,
Expand Down

0 comments on commit 9a2d9c7

Please sign in to comment.