pub struct PlatformHandle { /* private fields */ }Expand description
A lightweight handle to a window and its display connection.
This type implements both HasWindowHandle and HasDisplayHandle, allowing users to access
the underlying platform window and display connection.
This type is cheaply cloneable. All cloned handles will always refer to the same window and display connection.
Unlike the WindowContext and WindowHandle types however, this handle can be safely sent,
used, and dropped across threads (it implements Send and Sync).
However, it is not guaranteed that this handle can be successfully used from other threads, depending on the platform.
Similarly, this handle is actually a weak handle: while it remains safe to use, its methods
will always return HandleError::Unavailable if called after the window it refers to has been
destroyed.
§Platform compatibility notes
Depending on the platform, the PlatformHandle::window_handle method may return
HandleError::Unavailable if called from a thread other than the main thread (Even if the
window is still alive and well).
Trait Implementations§
Source§impl Clone for PlatformHandle
impl Clone for PlatformHandle
Source§fn clone(&self) -> PlatformHandle
fn clone(&self) -> PlatformHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PlatformHandle
impl Debug for PlatformHandle
Source§impl HasDisplayHandle for PlatformHandle
impl HasDisplayHandle for PlatformHandle
Source§fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
Source§impl HasWindowHandle for PlatformHandle
impl HasWindowHandle for PlatformHandle
Source§fn window_handle(&self) -> Result<WindowHandle<'_>, HandleError>
fn window_handle(&self) -> Result<WindowHandle<'_>, HandleError>
Auto Trait Implementations§
impl Freeze for PlatformHandle
impl RefUnwindSafe for PlatformHandle
impl Send for PlatformHandle
impl Sync for PlatformHandle
impl Unpin for PlatformHandle
impl UnsafeUnpin for PlatformHandle
impl UnwindSafe for PlatformHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> HasRawDisplayHandle for Twhere
T: HasDisplayHandle + ?Sized,
impl<T> HasRawDisplayHandle for Twhere
T: HasDisplayHandle + ?Sized,
Source§fn raw_display_handle(&self) -> Result<RawDisplayHandle, HandleError>
fn raw_display_handle(&self) -> Result<RawDisplayHandle, HandleError>
Use HasDisplayHandle instead
Source§impl<T> HasRawWindowHandle for Twhere
T: HasWindowHandle + ?Sized,
impl<T> HasRawWindowHandle for Twhere
T: HasWindowHandle + ?Sized,
Source§fn raw_window_handle(&self) -> Result<RawWindowHandle, HandleError>
fn raw_window_handle(&self) -> Result<RawWindowHandle, HandleError>
Use HasWindowHandle instead