pub trait RuntimeHandle<T: UserEvent>:
Debug
+ Clone
+ Send
+ Sync
+ Sized
+ 'static {
type Runtime: Runtime<T, Handle = Self>;
Show 13 methods
// Required methods
fn create_proxy(&self) -> <Self::Runtime as Runtime<T>>::EventLoopProxy;
fn request_exit(&self, code: i32) -> Result<()>;
fn create_window<F: Fn(RawWindow<'_>) + Send + 'static>(
&self,
pending: PendingWindow<T, Self::Runtime>,
after_window_creation: Option<F>,
) -> Result<DetachedWindow<T, Self::Runtime>>;
fn create_webview(
&self,
window_id: WindowId,
pending: PendingWebview<T, Self::Runtime>,
) -> Result<DetachedWebview<T, Self::Runtime>>;
fn run_on_main_thread<F: FnOnce() + Send + 'static>(
&self,
f: F,
) -> Result<()>;
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>;
fn primary_monitor(&self) -> Option<Monitor>;
fn monitor_from_point(&self, x: f64, y: f64) -> Option<Monitor>;
fn available_monitors(&self) -> Vec<Monitor>;
fn cursor_position(&self) -> Result<PhysicalPosition<f64>>;
fn set_theme(&self, theme: Option<Theme>);
fn fetch_data_store_identifiers<F: FnOnce(Vec<[u8; 16]>) + Send + 'static>(
&self,
cb: F,
) -> Result<()>;
fn remove_data_store<F: FnOnce(Result<()>) + Send + 'static>(
&self,
uuid: [u8; 16],
cb: F,
) -> Result<()>;
}
Expand description
A Send
handle to the runtime.
Required Associated Types§
Required Methods§
Sourcefn create_proxy(&self) -> <Self::Runtime as Runtime<T>>::EventLoopProxy
fn create_proxy(&self) -> <Self::Runtime as Runtime<T>>::EventLoopProxy
Creates an EventLoopProxy
that can be used to dispatch user events to the main event loop.
Sourcefn request_exit(&self, code: i32) -> Result<()>
fn request_exit(&self, code: i32) -> Result<()>
Requests an exit of the event loop.
Sourcefn create_window<F: Fn(RawWindow<'_>) + Send + 'static>(
&self,
pending: PendingWindow<T, Self::Runtime>,
after_window_creation: Option<F>,
) -> Result<DetachedWindow<T, Self::Runtime>>
fn create_window<F: Fn(RawWindow<'_>) + Send + 'static>( &self, pending: PendingWindow<T, Self::Runtime>, after_window_creation: Option<F>, ) -> Result<DetachedWindow<T, Self::Runtime>>
Create a new window.
Sourcefn create_webview(
&self,
window_id: WindowId,
pending: PendingWebview<T, Self::Runtime>,
) -> Result<DetachedWebview<T, Self::Runtime>>
fn create_webview( &self, window_id: WindowId, pending: PendingWebview<T, Self::Runtime>, ) -> Result<DetachedWebview<T, Self::Runtime>>
Create a new webview.
Sourcefn run_on_main_thread<F: FnOnce() + Send + 'static>(&self, f: F) -> Result<()>
fn run_on_main_thread<F: FnOnce() + Send + 'static>(&self, f: F) -> Result<()>
Run a task on the main thread.
Sourcefn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError>
Get a handle to the display controller of the windowing system.
Sourcefn primary_monitor(&self) -> Option<Monitor>
fn primary_monitor(&self) -> Option<Monitor>
Returns the primary monitor of the system.
Returns None if it can’t identify any monitor as a primary one.
Sourcefn monitor_from_point(&self, x: f64, y: f64) -> Option<Monitor>
fn monitor_from_point(&self, x: f64, y: f64) -> Option<Monitor>
Returns the monitor that contains the given point.
Sourcefn available_monitors(&self) -> Vec<Monitor>
fn available_monitors(&self) -> Vec<Monitor>
Returns the list of all the monitors available on the system.
Sourcefn cursor_position(&self) -> Result<PhysicalPosition<f64>>
fn cursor_position(&self) -> Result<PhysicalPosition<f64>>
Get the cursor position relative to the top-left hand corner of the desktop.
fn fetch_data_store_identifiers<F: FnOnce(Vec<[u8; 16]>) + Send + 'static>( &self, cb: F, ) -> Result<()>
Available on macOS or iOS only.
fn remove_data_store<F: FnOnce(Result<()>) + Send + 'static>( &self, uuid: [u8; 16], cb: F, ) -> Result<()>
Available on macOS or iOS only.
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.