tauri::test

Struct MockRuntime

Source
pub struct MockRuntime {
    pub context: RuntimeContext,
    /* private fields */
}
Available on crate feature test only.

Fields§

§context: RuntimeContext

Trait Implementations§

Source§

impl Debug for MockRuntime

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: UserEvent> Runtime<T> for MockRuntime

Source§

type WindowDispatcher = MockWindowDispatcher

The window message dispatcher.
Source§

type WebviewDispatcher = MockWebviewDispatcher

The webview message dispatcher.
Source§

type Handle = MockRuntimeHandle

The runtime handle type.
Source§

type EventLoopProxy = EventProxy

The proxy type.
Source§

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>

Available on Windows or Linux only.
Creates a new webview runtime on any thread.
Source§

fn create_proxy(&self) -> EventProxy

Creates an EventLoopProxy that can be used to dispatch user events to the main event loop.
Source§

fn handle(&self) -> Self::Handle

Gets a runtime handle.
Source§

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

Create a new webview.
Source§

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

Source§

fn monitor_from_point(&self, x: f64, y: f64) -> Option<Monitor>

Source§

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

Source§

fn set_theme(&self, theme: Option<Theme>)

Source§

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)

Runs an iteration of the runtime event loop and returns control flow to the caller.
Source§

fn run<F: FnMut(RunEvent<T>) + 'static>(self, callback: F)

Run the webview runtime.
Source§

fn cursor_position(&self) -> Result<PhysicalPosition<f64>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

impl<W> Runtime for W