rio_window::platform::windows

Trait WindowBorrowExtWindows

Source
pub trait WindowBorrowExtWindows: Borrow<Window> + Sized {
    // Provided method
    unsafe fn any_thread(self) -> AnyThread<Self> { ... }
}
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§