pub struct DynRuntime<T: UserEvent> { /* private fields */ }Expand description
A type-erased Runtime.
The concrete runtime is selected through its RuntimeInitAttrs,
see DynRuntimeInitAttrs::new.
Implementations§
Source§impl<T: UserEvent> DynRuntime<T>
impl<T: UserEvent> DynRuntime<T>
Sourcepub fn from_runtime<R: Runtime<T>>(runtime: R) -> Self
pub fn from_runtime<R: Runtime<T>>(runtime: R) -> Self
Wraps an already initialized runtime.
Prefer Runtime::new with DynRuntimeInitAttrs to let the runtime be initialized with the
application’s RuntimeInitArgs; this is only useful for runtimes created by other means.
Sourcepub fn downcast_ref<R: Runtime<T>>(&self) -> Option<&R>
pub fn downcast_ref<R: Runtime<T>>(&self) -> Option<&R>
Returns a reference to the wrapped runtime if it is of type R.
Sourcepub fn downcast_mut<R: Runtime<T>>(&mut self) -> Option<&mut R>
pub fn downcast_mut<R: Runtime<T>>(&mut self) -> Option<&mut R>
Returns a mutable reference to the wrapped runtime if it is of type R.
Trait Implementations§
Source§impl<T: UserEvent> Runtime<T> for DynRuntime<T>
impl<T: UserEvent> Runtime<T> for DynRuntime<T>
Source§type WindowDispatcher = DynWindowDispatcher<T>
type WindowDispatcher = DynWindowDispatcher<T>
The window message dispatcher.
Source§type WebviewDispatcher = DynWebviewDispatcher<T>
type WebviewDispatcher = DynWebviewDispatcher<T>
The webview message dispatcher.
Source§type Handle = DynRuntimeHandle<T>
type Handle = DynRuntimeHandle<T>
The runtime handle type.
Source§type EventLoopProxy = DynEventLoopProxy<T>
type EventLoopProxy = DynEventLoopProxy<T>
The proxy type.
Source§type RuntimeWebviewAttributes = DynWebviewAttributes
type RuntimeWebviewAttributes = DynWebviewAttributes
The runtime-specific webview attributes, set on the webview builders through the runtime’s extension traits. Read more
Source§type Webview = DynWebview
type Webview = DynWebview
The platform webview handle exposed through
WebviewDispatch::with_webview. Read moreSource§type RuntimeInitAttrs = DynRuntimeInitAttrs<T>
type RuntimeInitAttrs = DynRuntimeInitAttrs<T>
Runtime-specific initialization attributes. Also used to select this runtime, see
RuntimeInitAttrs.Source§type WindowOpener = DynWindowOpener
type WindowOpener = DynWindowOpener
Data about the window that requested the new window for
PendingWebview::new_window_handler.Source§fn new(args: RuntimeInitArgs<Self::RuntimeInitAttrs>) -> Result<Self>
fn new(args: RuntimeInitArgs<Self::RuntimeInitAttrs>) -> Result<Self>
Creates a new webview runtime. Must be used on the main thread.
Source§fn new_any_thread(args: RuntimeInitArgs<Self::RuntimeInitAttrs>) -> Result<Self>
fn new_any_thread(args: RuntimeInitArgs<Self::RuntimeInitAttrs>) -> Result<Self>
Available on DragonFly BSD or FreeBSD or Linux or NetBSD or OpenBSD or Windows only.
Creates a new webview runtime on any thread.
Source§fn create_proxy(&self) -> Self::EventLoopProxy
fn create_proxy(&self) -> Self::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>,
after_window_creation: Option<F>,
) -> Result<DetachedWindow<T, Self>>
fn create_window<F: Fn(RawWindow<'_>) + Send + 'static>( &self, pending: PendingWindow<T, Self>, after_window_creation: Option<F>, ) -> Result<DetachedWindow<T, Self>>
Create a new window.
Source§fn create_webview(
&self,
window_id: WindowId,
pending: PendingWebview<T, Self>,
) -> Result<DetachedWebview<T, Self>>
fn create_webview( &self, window_id: WindowId, pending: PendingWebview<T, Self>, ) -> Result<DetachedWebview<T, Self>>
Create a new webview.
Source§fn primary_monitor(&self) -> Option<Monitor>
fn primary_monitor(&self) -> Option<Monitor>
Returns the primary monitor of the system. Read more
Source§fn 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.
Source§fn available_monitors(&self) -> Vec<Monitor>
fn available_monitors(&self) -> Vec<Monitor>
Returns the list of all the monitors available on the system.
Source§fn 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.
Source§fn set_device_event_filter(&mut self, filter: DeviceEventFilter)
fn set_device_event_filter(&mut self, filter: DeviceEventFilter)
Change the device event filter mode. Read more
Source§fn run_iteration<F: FnMut(RunEvent<T>) + 'static>(&mut self, callback: F)
fn run_iteration<F: FnMut(RunEvent<T>) + 'static>(&mut self, callback: F)
Available on
desktop only.Runs an iteration of the runtime event loop and returns control flow to the caller.
Source§fn run_return<F: FnMut(RunEvent<T>) + 'static>(self, callback: F) -> i32
fn run_return<F: FnMut(RunEvent<T>) + 'static>(self, callback: F) -> i32
Equivalent to
Runtime::run but returns the exit code instead of exiting the process.Auto Trait Implementations§
impl<T> !RefUnwindSafe for DynRuntime<T>
impl<T> !Send for DynRuntime<T>
impl<T> !Sync for DynRuntime<T>
impl<T> !UnwindSafe for DynRuntime<T>
impl<T> Freeze for DynRuntime<T>
impl<T> Unpin for DynRuntime<T>
impl<T> UnsafeUnpin for DynRuntime<T>where
Box<dyn ErasedRuntime<T>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more