diff --git a/winit-appkit/src/lib.rs b/winit-appkit/src/lib.rs index 3d3df653a..e08026995 100644 --- a/winit-appkit/src/lib.rs +++ b/winit-appkit/src/lib.rs @@ -334,6 +334,7 @@ impl WindowExtMacOS for dyn Window + '_ { /// Corresponds to `NSApplicationActivationPolicy`. #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum ActivationPolicy { /// Corresponds to `NSApplicationActivationPolicyRegular`. #[default] diff --git a/winit-common/src/xkb/mod.rs b/winit-common/src/xkb/mod.rs index 21032dc0e..d001f8521 100644 --- a/winit-common/src/xkb/mod.rs +++ b/winit-common/src/xkb/mod.rs @@ -41,6 +41,7 @@ pub fn reset_dead_keys() { } #[derive(Debug)] +#[non_exhaustive] pub enum Error { /// libxkbcommon is not available XKBNotFound, diff --git a/winit-uikit/src/lib.rs b/winit-uikit/src/lib.rs index 44c9dc708..919dbc822 100644 --- a/winit-uikit/src/lib.rs +++ b/winit-uikit/src/lib.rs @@ -418,6 +418,7 @@ impl MonitorHandleExtIOS for MonitorHandle { /// Valid orientations for a particular [`Window`]. #[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum ValidOrientations { /// Excludes `PortraitUpsideDown` on iphone #[default] @@ -448,6 +449,7 @@ bitflags::bitflags! { #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum StatusBarStyle { #[default] Default, diff --git a/winit-web/src/lib.rs b/winit-web/src/lib.rs index 70650846d..b34d16875 100644 --- a/winit-web/src/lib.rs +++ b/winit-web/src/lib.rs @@ -417,6 +417,7 @@ impl ActiveEventLoopExtWeb for dyn ActiveEventLoop + '_ { /// Strategy used for [`ControlFlow::Poll`][crate::event_loop::ControlFlow::Poll]. #[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum PollStrategy { /// Uses [`Window.requestIdleCallback()`] to queue the next event loop. If not available /// this will fallback to [`setTimeout()`]. @@ -444,6 +445,7 @@ pub enum PollStrategy { /// Strategy used for [`ControlFlow::WaitUntil`][crate::event_loop::ControlFlow::WaitUntil]. #[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum WaitUntilStrategy { /// Uses the [Prioritized Task Scheduling API] to queue the next event loop. If not available /// this will fallback to [`setTimeout()`]. @@ -478,6 +480,7 @@ impl Future for CustomCursorFuture { #[derive(Clone, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum CustomCursorError { Blob, Decode(String), @@ -507,6 +510,7 @@ impl Future for MonitorPermissionFuture { } #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[non_exhaustive] pub enum MonitorPermissionError { /// User has explicitly denied permission to query detailed monitor information. Denied, @@ -664,6 +668,7 @@ impl Future for OrientationLockFuture { } #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[non_exhaustive] pub enum OrientationLockError { Unsupported, Busy, diff --git a/winit-win32/src/lib.rs b/winit-win32/src/lib.rs index 4693875b4..c5a4cd41d 100644 --- a/winit-win32/src/lib.rs +++ b/winit-win32/src/lib.rs @@ -54,6 +54,7 @@ pub type HMONITOR = *mut c_void; /// [`DWM_SYSTEMBACKDROP_TYPE docs`]: https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwm_systembackdrop_type #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum BackdropType { /// Corresponds to `DWMSBT_AUTO`. /// @@ -113,6 +114,7 @@ impl Default for Color { #[repr(i32)] #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum CornerPreference { /// Corresponds to `DWMWCP_DEFAULT`. /// diff --git a/winit-x11/src/dnd.rs b/winit-x11/src/dnd.rs index af4f86eca..24247bf4f 100644 --- a/winit-x11/src/dnd.rs +++ b/winit-x11/src/dnd.rs @@ -22,6 +22,7 @@ pub enum DndState { } #[derive(Debug)] +#[non_exhaustive] pub enum UriListParseError { EmptyData, InvalidUtf8(#[allow(dead_code)] Utf8Error), diff --git a/winit-x11/src/lib.rs b/winit-x11/src/lib.rs index 79c9d05e8..1551ed1a6 100644 --- a/winit-x11/src/lib.rs +++ b/winit-x11/src/lib.rs @@ -32,6 +32,7 @@ pub use dnd::{Selection, SelectionReader, SelectionType, UriListParseError}; /// [`_NET_WM_WINDOW_TYPE`](https://specifications.freedesktop.org/wm-spec/wm-spec-1.5.html). #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum WindowType { /// A desktop feature. This can include a single window containing desktop icons with the same /// dimensions as the screen, allowing the desktop environment to have full control of the