Trait winit::platform::windows::WindowBorrowExtWindows

source ·
pub trait WindowBorrowExtWindows: Borrow<Window> + Sized {
    // Provided method
    unsafe fn any_thread(self) -> AnyThread<Self> { ... }
}
Available on windows_platform only.
Expand description

Additional methods for anything that dereference to Window.

Provided Methods§

source

unsafe fn any_thread(self) -> AnyThread<Self>

Create an object that allows accessing the inner window handle in a thread-unsafe way.

It is possible to call window_handle_any_thread to get around Windows’s thread affinity limitations. However, it may be desired to pass the Window into something that requires the HasWindowHandle trait, while ignoring thread affinity limitations.

This function wraps anything that implements Borrow<Window> into a structure that uses the inner window handle as a mean of implementing HasWindowHandle. It wraps Window, &Window, Arc<Window>, and other reference types.

§Safety

It is the responsibility of the user to only pass the window handle into thread-safe Win32 APIs.

Object Safety§

This trait is not object safe.

Implementors§