From 3f9f87800b205fa76b49629f1e6d56579cca9e30 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 17 Dec 2022 18:42:02 +0100 Subject: [PATCH] Add an invalid raw handle When we want to return an empty or invalid handle, it is possible to create an empty handle for an arbitrary platform, but if there is a dedicated enum value for it, then we don't have to pick an arbitrary platform. --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 01c70a5..11987d7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -97,6 +97,8 @@ unsafe impl HasRawWindowHandle for alloc::sync:: #[non_exhaustive] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum RawWindowHandle { + /// Not a valid raw handle + Invalid, /// A raw window handle for UIKit (Apple's non-macOS windowing library). /// /// ## Availability Hints @@ -232,6 +234,8 @@ unsafe impl HasRawDisplayHandle for alloc::sync #[non_exhaustive] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum RawDisplayHandle { + /// Not a valid raw handle + Invalid, /// A raw display handle for UIKit (Apple's non-macOS windowing library). /// /// ## Availability Hints