summaryrefslogtreecommitdiffstats
path: root/native/src/window/id.rs
blob: 56496aaa901af37c5aa0de7c297a59c3e8498a4f (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, PartialEq, Eq, Hash)]
/// 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())
    }
}