Skip to main content

WindowHandle

Trait WindowHandle 

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

A window/display handle pair, as one trait.

Presenters receive raw-window-handle types, not a concrete winit::window::Window: softbuffer, wgpu, and glutin all accept these handles directly, so any windowing library that produces them can drive the same presenter, and only this crate depends on winit itself.

raw-window-handle has no combined trait, and surface libraries need to own the handle (softbuffer stores it for the surface’s lifetime), so presenters receive Arc<dyn WindowHandle> – rwh implements the handle traits for Arc<H: ?Sized>, so the trait object passes straight into softbuffer::Surface::new / wgpu::Instance::create_surface.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§