Skip to main content

WindowSource

Trait WindowSource 

Source
pub trait WindowSource:
    HasWindowHandle
    + HasDisplayHandle
    + Debug
    + Send
    + Sync { }
Expand description

Anything a presentation surface can be created from. Embedders hand the engine their window behind this trait; the engine never names a windowing toolkit.

Native window handles may cross worker threads. Browser canvas handles are bound to the JavaScript main thread, so requiring Send + Sync there would reject the platform’s real WebGPU resources.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T: HasWindowHandle + HasDisplayHandle + Debug + Send + Sync> WindowSource for T

Available on not (target_os=unknown and WebAssembly).