Skip to main content

WindowHandle

Trait WindowHandle 

Source
pub trait WindowHandle:
    HasWindowHandle
    + HasDisplayHandle
    + Debug { }
Expand description

A marker trait that combines windowing handle requirements for use in trait objects.

Rust’s trait object safety rules require that a trait’s supertraits must also be object-safe. HasWindowHandle and HasDisplayHandle are, but creating a direct dyn HasWindowHandle + HasDisplayHandle is complex. This trait serves as a simple, unified supertrait to make creating the KhoraWindowHandle type alias possible.

Debug is required so the handle can be stored inside wgpu::InstanceDescriptor (its display field requires WgpuHasDisplayHandle: Debug).

Implementors§

Source§

impl<T: HasWindowHandle + HasDisplayHandle + Debug> WindowHandle for T