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
Available on crate feature rwh_06
only.
impl HasDisplayHandle for ActiveEventLoop
rwh_06
only.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
Available on crate feature rwh_06
only.
impl HasDisplayHandle for OwnedDisplayHandle
rwh_06
only.fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl HasDisplayHandle for Window
Available on crate feature rwh_06
only.
impl HasDisplayHandle for Window
rwh_06
only.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>
§impl<H> HasDisplayHandle for Box<H>where
H: HasDisplayHandle + ?Sized,
Available on crate feature alloc
only.
impl<H> HasDisplayHandle for Box<H>where
H: HasDisplayHandle + ?Sized,
alloc
only.fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl<H> HasDisplayHandle for Rc<H>where
H: HasDisplayHandle + ?Sized,
Available on crate feature alloc
only.
impl<H> HasDisplayHandle for Rc<H>where
H: HasDisplayHandle + ?Sized,
alloc
only.fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl<H> HasDisplayHandle for Arc<H>where
H: HasDisplayHandle + ?Sized,
Available on crate feature alloc
only.
impl<H> HasDisplayHandle for Arc<H>where
H: HasDisplayHandle + ?Sized,
alloc
only.fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
§impl<T> HasDisplayHandle for EventLoop<T>
Available on crate feature rwh_06
only.
impl<T> HasDisplayHandle for EventLoop<T>
rwh_06
only.