cliquenet/id.rs
1#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
2pub struct Id(pub(crate) u64);
3
4impl From<u64> for Id {
5 fn from(n: u64) -> Self {
6 Self(n)
7 }
8}
9
10impl From<Id> for u64 {
11 fn from(n: Id) -> Self {
12 n.0
13 }
14}
15
16impl std::hash::Hash for Id {
17 fn hash<H: std::hash::Hasher>(&self, h: &mut H) {
18 h.write_u64(self.0)
19 }
20}
21
22impl nohash_hasher::IsEnabled for Id {}