pub trait WindowProvider: 'static {
type Handle: GPUSurfaceHandle;
type Exposed: Clone + Send + Sync + 'static;
// Required methods
fn create(config: &WindowConfig) -> Self;
fn size(handle: &Self::Handle) -> (u32, u32);
fn exposed(&self) -> Self::Exposed;
fn handle(&self) -> &Self::Handle;
}Expand description
Abstracts over a platform-specific window implementation.
Implement this trait to plug in any windowing library (e.g. winit). The associated types expose the window handle used for surface creation and an “exposed” value (e.g. a shareable Arc) that systems can inspect.
Required Associated Types§
Sourcetype Handle: GPUSurfaceHandle
type Handle: GPUSurfaceHandle
The concrete window handle type used to create a GPU surface.
Required Methods§
Sourcefn create(config: &WindowConfig) -> Self
fn create(config: &WindowConfig) -> Self
Create a window using the provided configuration.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".