diff options
author | 2022-06-21 15:59:45 -0300 | |
---|---|---|
committer | 2023-01-09 11:27:04 -0800 | |
commit | ec56c0686df1a200e37af951a3a8eca562c32a5c (patch) | |
tree | db24f45a8c3ec6288b470ea4194ad2654c1e8068 /native/src/window | |
parent | 8fdd5ee8b60e551088d4a18fb1d58b6c3e62ba7d (diff) | |
download | iced-ec56c0686df1a200e37af951a3a8eca562c32a5c.tar.gz iced-ec56c0686df1a200e37af951a3a8eca562c32a5c.tar.bz2 iced-ec56c0686df1a200e37af951a3a8eca562c32a5c.zip |
Introduce opaque `window::Id` type
Diffstat (limited to 'native/src/window')
-rw-r--r-- | native/src/window/id.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/native/src/window/id.rs b/native/src/window/id.rs new file mode 100644 index 00000000..56496aaa --- /dev/null +++ b/native/src/window/id.rs @@ -0,0 +1,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()) + } +} |