Skip to main content

HostMainThreadCaller

Trait HostMainThreadCaller 

Source
pub trait HostMainThreadCaller: Send + 'static {
    // Required method
    fn call_main_thread(&mut self);
}
Expand description

A special handler for the Window thread to wake up and call methods on the main thread.

WindowHandle::host_main_thread_callback should be called as a response to this.

§Platform compatibility notes

This is only needed on X11, as Windows and macOS windows already run on the main thread.

Required Methods§

Source

fn call_main_thread(&mut self)

Schedules a callback on the main thread.

WindowHandle::host_main_thread_callback should be called as a response to this.

§Platform compatibility notes

Only X11 needs this. This can be implemented as a no-op on Windows and macOS.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§