#[non_exhaustive]
pub enum RawWindowHandle {
    UiKit(UiKitHandle),
    AppKit(AppKitHandle),
    Orbital(OrbitalHandle),
    Xlib(XlibHandle),
    Xcb(XcbHandle),
    Wayland(WaylandHandle),
    Win32(Win32Handle),
    WinRt(WinRtHandle),
    Web(WebHandle),
    AndroidNdk(AndroidNdkHandle),
    Haiku(HaikuHandle),
}
Expand description

An enum to simply combine the different possible raw window handle variants.

Variant Availability

Note that all variants are present on all targets (none are disabled behind #[cfg]s), but see the “Availability Hints” section on each variant for some hints on where this variant might be expected.

Note that these “Availability Hints” are not normative. That is to say, a HasRawWindowHandle implementor is completely allowed to return something unexpected. (For example, it’s legal for someone to return a RawWindowHandle::Xlib on macOS, it would just be weird, and probably requires something like XQuartz be used).

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

UiKit(UiKitHandle)

A raw window handle for UIKit (Apple’s non-macOS windowing library).

Availability Hints

This variant is likely to be used on iOS, tvOS, (in theory) watchOS, and Mac Catalyst ($arch-apple-ios-macabi targets, which can notably use UIKit or AppKit), as these are the targets that (currently) support UIKit.

AppKit(AppKitHandle)

A raw window handle for AppKit.

Availability Hints

This variant is likely to be used on macOS, although Mac Catalyst ($arch-apple-ios-macabi targets, which can notably use UIKit or AppKit) can also use it despite being target_os = "ios".

Orbital(OrbitalHandle)

A raw window handle for the Redox operating system.

Availability Hints

This variant is used by the Orbital Windowing System in the Redox operating system.

Xlib(XlibHandle)

A raw window handle for Xlib.

Availability Hints

This variant is likely to show up anywhere someone manages to get X11 working that Xlib can be built for, which is to say, most (but not all) Unix systems.

Xcb(XcbHandle)

A raw window handle for Xcb.

Availability Hints

This variant is likely to show up anywhere someone manages to get X11 working that XCB can be built for, which is to say, most (but not all) Unix systems.

Wayland(WaylandHandle)

A raw window handle for Wayland.

Availability Hints

This variant should be expected anywhere Wayland works, which is currently some subset of unix systems.

Win32(Win32Handle)

A raw window handle for Win32.

Availability Hints

This variant is used on Windows systems.

WinRt(WinRtHandle)

A raw window handle for WinRT.

Availability Hints

This variant is used on Windows systems.

Web(WebHandle)

A raw window handle for the Web.

Availability Hints

This variant is used on Wasm or asm.js targets when targeting the Web/HTML5.

AndroidNdk(AndroidNdkHandle)

A raw window handle for Android NDK.

Availability Hints

This variant is used on Android targets.

Haiku(HaikuHandle)

A raw window handle for Haiku.

Availability Hints

This variant is used on HaikuOS.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.