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.

(This is a re-implementation of baseview::host::HostMainThreadCaller to avoid directly depending on baseview until it is stabilized.)

§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.

§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§