pub trait HasDisplayHandle {
// Required method
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>;
}
Expand description
A display that acts as a wrapper around a display handle.
Objects that implement this trait should be able to return a DisplayHandle
for the display
that they are associated with. This handle should last for the lifetime of the object, and should
return an error if the application is inactive.
Implementors of this trait will be windowing systems, like winit
and sdl2
. These windowing
systems should implement this trait on types that represent the top-level display server. It
should be implemented by tying the lifetime of the DisplayHandle
to the lifetime of the
display object.
Users of this trait will include graphics libraries, like wgpu
and glutin
. These APIs
should be generic over a type that implements HasDisplayHandle
, and should use the
DisplayHandle
type to access the display handle.
Note that these requirements are not enforced on HasDisplayHandle
, rather, they are enforced on the
constructors of DisplayHandle
. This is because the HasDisplayHandle
trait is safe to implement.
Required Methods§
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
Get a handle to the display controller of the windowing system.