gpui_platform/window_id.rs
1//! Window identifiers shared by `gpui` and its platform backends.
2
3slotmap::new_key_type! {
4 /// A unique identifier for a window.
5 pub struct WindowId;
6}
7
8impl WindowId {
9 /// Converts this window ID to a `u64`.
10 pub fn as_u64(&self) -> u64 {
11 self.0.as_ffi()
12 }
13}
14
15impl From<u64> for WindowId {
16 fn from(value: u64) -> Self {
17 WindowId(slotmap::KeyData::from_ffi(value))
18 }
19}