pub trait RuntimeHandle<T: UserEvent>: Debug + Clone + Send + Sync + Sized + 'static {
    type Runtime: Runtime<T, Handle = Self>;

    // Required methods
    fn create_proxy(&self) -> <Self::Runtime as Runtime<T>>::EventLoopProxy;
    fn create_window<F: Fn(RawWindow<'_>) + Send + 'static>(
        &self,
        pending: PendingWindow<T, Self::Runtime>,
        before_webview_creation: Option<F>
    ) -> Result<DetachedWindow<T, Self::Runtime>>;
    fn run_on_main_thread<F: FnOnce() + Send + 'static>(
        &self,
        f: F
    ) -> Result<()>;
    fn raw_display_handle(&self) -> RawDisplayHandle;
    fn primary_monitor(&self) -> Option<Monitor>;
    fn available_monitors(&self) -> Vec<Monitor>;
    fn find_class<'a>(
        &self,
        env: &mut JNIEnv<'a>,
        activity: &JObject<'_>,
        name: impl Into<String>
    ) -> Result<JClass<'a>, Error>;
    fn run_on_android_context<F>(&self, f: F)
       where F: FnOnce(&mut JNIEnv<'_>, &JObject<'_>, &JObject<'_>) + Send + 'static;
}
Expand description

A Send handle to the runtime.

Required Associated Types§

source

type Runtime: Runtime<T, Handle = Self>

Required Methods§

source

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.

source

fn create_window<F: Fn(RawWindow<'_>) + Send + 'static>( &self, pending: PendingWindow<T, Self::Runtime>, before_webview_creation: Option<F> ) -> Result<DetachedWindow<T, Self::Runtime>>

Create a new webview window.

source

fn run_on_main_thread<F: FnOnce() + Send + 'static>(&self, f: F) -> Result<()>

Run a task on the main thread.

source

fn raw_display_handle(&self) -> RawDisplayHandle

source

fn primary_monitor(&self) -> Option<Monitor>

source

fn available_monitors(&self) -> Vec<Monitor>

source

fn find_class<'a>( &self, env: &mut JNIEnv<'a>, activity: &JObject<'_>, name: impl Into<String> ) -> Result<JClass<'a>, Error>

Finds an Android class in the project scope.

source

fn run_on_android_context<F>(&self, f: F)where F: FnOnce(&mut JNIEnv<'_>, &JObject<'_>, &JObject<'_>) + Send + 'static,

Dispatch a closure to run on the Android context.

The closure takes the JNI env, the Android activity instance and the possibly null webview.

Object Safety§

This trait is not object safe.

Implementors§