|
1 | 1 | //! CAN Identifiers.
|
2 | 2 |
|
3 | 3 | /// Standard 11-bit CAN Identifier (`0..=0x7FF`).
|
4 |
| -#[derive(Debug, Copy, Clone, Eq, PartialEq)] |
| 4 | +#[derive(Debug, Copy, Clone, Eq, PartialEq, PartialOrd, Ord, Hash)] |
5 | 5 | pub struct StandardId(u16);
|
6 | 6 |
|
7 | 7 | impl StandardId {
|
@@ -40,7 +40,7 @@ impl StandardId {
|
40 | 40 | }
|
41 | 41 |
|
42 | 42 | /// Extended 29-bit CAN Identifier (`0..=1FFF_FFFF`).
|
43 |
| -#[derive(Debug, Copy, Clone, Eq, PartialEq)] |
| 43 | +#[derive(Debug, Copy, Clone, Eq, PartialEq, PartialOrd, Ord, Hash)] |
44 | 44 | pub struct ExtendedId(u32);
|
45 | 45 |
|
46 | 46 | impl ExtendedId {
|
@@ -85,7 +85,7 @@ impl ExtendedId {
|
85 | 85 | }
|
86 | 86 |
|
87 | 87 | /// A CAN Identifier (standard or extended).
|
88 |
| -#[derive(Debug, Copy, Clone, Eq, PartialEq)] |
| 88 | +#[derive(Debug, Copy, Clone, Eq, PartialEq, PartialOrd, Ord, Hash)] |
89 | 89 | pub enum Id {
|
90 | 90 | /// Standard 11-bit Identifier (`0..=0x7FF`).
|
91 | 91 | Standard(StandardId),
|
|
0 commit comments