-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I don't recall the reasoning for keeping RawWindowHandle around, is there ever a case where it's useful? And wouldn't WindowHandle<'static> be able to serve that same purpose?
I propose we change our API to merge these, so that it's instead something like:
#[non_exhaustive]
enum WindowHandle<'window> {
AppKit(AppKitWindowHandle<'window>),
UIKit(UIKitWindowHandle<'window>),
AndroidNDK(AndroidNDKWindowHandle<'window>),
// ... etc.
}This means that instead of a three-step process for making safe handles (create raw platform handle + wrap in RawWindowHandle + call WindowHandle::borrow_raw), it's now only two steps (create raw platform handle with lifetime + wrap it in WindowHandle).
One reason to not do this would be to mirror the std::os::fd API (RawFd vs BorrowedFd<'_>), but we already can't do that, because we can't provide a mirror of OwnedFd.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request