summaryrefslogtreecommitdiffstats
path: root/native/src/window/id.rs
blob: 059cf4e739136f64d43cc40fa73f0ab12f88d02c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
/// TODO(derezzedex)
pub struct Id(u64);

impl Id {
    /// TODO(derezzedex)
    pub fn new(id: impl Hash) -> Id {
        let mut hasher = DefaultHasher::new();
        id.hash(&mut hasher);

        Id(hasher.finish())
    }
}