pub struct MockRuntime {
pub context: RuntimeContext,
/* private fields */
}
Available on crate feature
test
only.Fields§
§context: RuntimeContext
Trait Implementations§
Source§impl Debug for MockRuntime
impl Debug for MockRuntime
Source§impl<T: UserEvent> Runtime<T> for MockRuntime
impl<T: UserEvent> Runtime<T> for MockRuntime
Source§type WindowDispatcher = MockWindowDispatcher
type WindowDispatcher = MockWindowDispatcher
The window message dispatcher.
Source§type WebviewDispatcher = MockWebviewDispatcher
type WebviewDispatcher = MockWebviewDispatcher
The webview message dispatcher.
Source§type Handle = MockRuntimeHandle
type Handle = MockRuntimeHandle
The runtime handle type.
Source§type EventLoopProxy = EventProxy
type EventLoopProxy = EventProxy
The proxy type.
Source§fn new(_args: RuntimeInitArgs) -> Result<Self>
fn new(_args: RuntimeInitArgs) -> Result<Self>
Creates a new webview runtime. Must be used on the main thread.
Source§fn new_any_thread(_args: RuntimeInitArgs) -> Result<Self>
fn new_any_thread(_args: RuntimeInitArgs) -> Result<Self>
Available on Windows or Linux only.
Creates a new webview runtime on any thread.
Source§fn create_proxy(&self) -> EventProxy
fn create_proxy(&self) -> EventProxy
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 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>)>(&mut self, callback: F)
fn run_iteration<F: FnMut(RunEvent<T>)>(&mut self, callback: F)
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.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.
Auto Trait Implementations§
impl Freeze for MockRuntime
impl !RefUnwindSafe for MockRuntime
impl Send for MockRuntime
impl !Sync for MockRuntime
impl Unpin for MockRuntime
impl !UnwindSafe for MockRuntime
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