pub enum PlatformWindowHandle {
Win32(*mut c_void),
X11(u64),
Wayland(*mut c_void),
Other(*mut c_void),
}Expand description
平台窗口句柄:跨平台的最小公共表达。
变体只携带“够用“的信息,具体语义由各后端自己解释:
- Win32:
HWND指针 - X11:XID(
u64) - Wayland:
wl_surface* - 其余平台暂用
Other(携带不透明指针,后端自行解释)
§Safety
句柄必须在后端使用期间保持有效;本模块不校验有效性(无法校验)。
Variants§
Win32(*mut c_void)
Win32 HWND。
X11(u64)
X11 Window(XID)。
Wayland(*mut c_void)
Wayland wl_surface*。
Other(*mut c_void)
未明确支持的平台。使用前必须由后端与 PlatformRuntime 共同约定 指针的具体含义(例如 WASM 的 canvas 句柄、Metal 的 layer 指针)。
Trait Implementations§
Source§impl Clone for PlatformWindowHandle
impl Clone for PlatformWindowHandle
impl Copy for PlatformWindowHandle
Auto Trait Implementations§
impl !Send for PlatformWindowHandle
impl !Sync for PlatformWindowHandle
impl Forget for PlatformWindowHandle
impl Freeze for PlatformWindowHandle
impl Move for PlatformWindowHandle
impl RefUnwindSafe for PlatformWindowHandle
impl Unpin for PlatformWindowHandle
impl UnsafeUnpin for PlatformWindowHandle
impl UnwindSafe for PlatformWindowHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more