Skip to content

Commit

Permalink
Document into_raw/from_raw
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Sep 8, 2024
1 parent 7cf6f7d commit 49f6ddf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,16 @@ impl WindowId {
WindowId(platform_impl::WindowId::dummy())
}

/// Convert the `WindowId` into the underlying integer.
///
/// This is useful if you need to pass the ID across an FFI boundary, or store it in an atomic.
pub const fn into_raw(self) -> u64 {
self.0.into_raw()
}

/// Construct a `WindowId` from the underlying integer.
///
/// This should only be called with integers returned from [`WindowId::into_raw`].
pub const fn from_raw(id: u64) -> Self {
Self(platform_impl::WindowId::from_raw(id))
}
Expand Down

0 comments on commit 49f6ddf

Please sign in to comment.