//! Window identifiers shared by `gpui` and its platform backends.
slotmap::new_key_type! {
/// A unique identifier for a window.
pub struct WindowId;
}
impl WindowId {
/// Converts this window ID to a `u64`.
pub fn as_u64(&self) -> u64 {
self.0.as_ffi()
}
}
impl From<u64> for WindowId {
fn from(value: u64) -> Self {
WindowId(slotmap::KeyData::from_ffi(value))
}
}