Trait HasDisplayHandle
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.
Implementations on Foreign Types§
§impl HasDisplayHandle for ActiveEventLoop
impl HasDisplayHandle for ActiveEventLoop
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl HasDisplayHandle for ActiveEventLoop
impl HasDisplayHandle for ActiveEventLoop
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl HasDisplayHandle for EventLoop
impl HasDisplayHandle for EventLoop
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl HasDisplayHandle for NoDisplayHandle
impl HasDisplayHandle for NoDisplayHandle
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl HasDisplayHandle for OwnedDisplayHandle
impl HasDisplayHandle for OwnedDisplayHandle
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl HasDisplayHandle for Window
impl HasDisplayHandle for Window
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl HasDisplayHandle for Window
impl HasDisplayHandle for Window
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl HasDisplayHandle for dyn ActiveEventLoop + '_
impl HasDisplayHandle for dyn ActiveEventLoop + '_
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl HasDisplayHandle for dyn Window + '_
impl HasDisplayHandle for dyn Window + '_
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl<H> HasDisplayHandle for &Hwhere
H: HasDisplayHandle + ?Sized,
impl<H> HasDisplayHandle for &Hwhere
H: HasDisplayHandle + ?Sized,
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl<H> HasDisplayHandle for &mut Hwhere
H: HasDisplayHandle + ?Sized,
impl<H> HasDisplayHandle for &mut Hwhere
H: HasDisplayHandle + ?Sized,
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
Implementors§
impl HasDisplayHandle for SctkWinitWindow
impl<'a> HasDisplayHandle for DisplayHandle<'a>
impl<H> HasDisplayHandle for Box<H>where
H: HasDisplayHandle + ?Sized,
alloc only.impl<H> HasDisplayHandle for Rc<H>where
H: HasDisplayHandle + ?Sized,
alloc only.impl<H> HasDisplayHandle for Arc<H>where
H: HasDisplayHandle + ?Sized,
alloc only.