pub struct ParentHandle { /* private fields */ }Expand description
Opaque pair of platform handles describing a parent window for a
native OS dialog. Construct with ParentHandle::from_window on
the main thread.
Implements HasWindowHandle and HasDisplayHandle so backend
code can hand it directly to APIs like rfd::AsyncFileDialog::set_parent
without an intermediate adapter type.
Implementations§
Source§impl ParentHandle
impl ParentHandle
Sourcepub fn from_window<W>(window: &W) -> Option<Self>
pub fn from_window<W>(window: &W) -> Option<Self>
Extract the platform handles from a winit window.
MUST be called on the main thread — winit’s handle accessors
are documented as main-thread-only on macOS / Wayland.
Returns None if either handle accessor fails (rare; mostly
during teardown when the underlying surface is already gone).
Sourcepub fn raw_window_handle(&self) -> RawWindowHandle
pub fn raw_window_handle(&self) -> RawWindowHandle
Raw window handle bytes. Use when the consuming API wants the
enum directly rather than the borrowed WindowHandle<'_>
returned by HasWindowHandle::window_handle.
Sourcepub fn raw_display_handle(&self) -> RawDisplayHandle
pub fn raw_display_handle(&self) -> RawDisplayHandle
Raw display handle bytes. Paired with
Self::raw_window_handle.
Trait Implementations§
Source§impl Clone for ParentHandle
impl Clone for ParentHandle
Source§fn clone(&self) -> ParentHandle
fn clone(&self) -> ParentHandle
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 ParentHandle
impl Debug for ParentHandle
Source§impl HasDisplayHandle for ParentHandle
impl HasDisplayHandle for ParentHandle
Source§fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
Source§impl HasWindowHandle for ParentHandle
impl HasWindowHandle for ParentHandle
Source§fn window_handle(&self) -> Result<WindowHandle<'_>, HandleError>
fn window_handle(&self) -> Result<WindowHandle<'_>, HandleError>
impl Send for ParentHandle
impl Sync for ParentHandle
Auto Trait Implementations§
impl Freeze for ParentHandle
impl RefUnwindSafe for ParentHandle
impl Unpin for ParentHandle
impl UnsafeUnpin for ParentHandle
impl UnwindSafe for ParentHandle
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