Struct tauri::test::MockDispatcher

source ·
pub struct MockDispatcher { /* private fields */ }
Available on crate feature test only.

Implementations§

Trait Implementations§

source§

impl Clone for MockDispatcher

source§

fn clone(&self) -> MockDispatcher

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MockDispatcher

source§

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

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

impl<T: UserEvent> Dispatch<T> for MockDispatcher

§

type Runtime = MockRuntime

The runtime this Dispatch runs under.
§

type WindowBuilder = MockWindowBuilder

The window builder type.
source§

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

Run a task on the main thread.
source§

fn on_window_event<F: Fn(&WindowEvent) + Send + 'static>(&self, f: F) -> Uuid

Registers a window event handler.
source§

fn on_menu_event<F: Fn(&MenuEvent) + Send + 'static>(&self, f: F) -> Uuid

Registers a window event handler.
source§

fn open_devtools(&self)

Open the web inspector which is usually called devtools.
source§

fn close_devtools(&self)

Close the web inspector which is usually called devtools.
source§

fn is_devtools_open(&self) -> Result<bool>

Gets the devtools window’s current open state.
source§

fn url(&self) -> Result<Url>

Returns the webview’s current URL.
source§

fn scale_factor(&self) -> Result<f64>

Returns the scale factor that can be used to map logical pixels to physical pixels, and vice versa.
source§

fn inner_position(&self) -> Result<PhysicalPosition<i32>>

Returns the position of the top-left hand corner of the window’s client area relative to the top-left hand corner of the desktop.
source§

fn outer_position(&self) -> Result<PhysicalPosition<i32>>

Returns the position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.
source§

fn inner_size(&self) -> Result<PhysicalSize<u32>>

Returns the physical size of the window’s client area. Read more
source§

fn outer_size(&self) -> Result<PhysicalSize<u32>>

Returns the physical size of the entire window. Read more
source§

fn is_fullscreen(&self) -> Result<bool>

Gets the window’s current fullscreen state.
source§

fn is_minimized(&self) -> Result<bool>

Gets the window’s current minimized state.
source§

fn is_maximized(&self) -> Result<bool>

Gets the window’s current maximized state.
source§

fn is_focused(&self) -> Result<bool>

Gets the window’s current focus state.
source§

fn is_decorated(&self) -> Result<bool>

Gets the window’s current decoration state.
source§

fn is_resizable(&self) -> Result<bool>

Gets the window’s current resizable state.
source§

fn is_maximizable(&self) -> Result<bool>

Gets the window’s native maximize button state. Read more
source§

fn is_minimizable(&self) -> Result<bool>

Gets the window’s native minize button state. Read more
source§

fn is_closable(&self) -> Result<bool>

Gets the window’s native close button state. Read more
source§

fn is_visible(&self) -> Result<bool>

Gets the window’s current visibility state.
source§

fn title(&self) -> Result<String>

Gets the window’s current title.
source§

fn is_menu_visible(&self) -> Result<bool>

Gets the window menu current visibility state.
source§

fn current_monitor(&self) -> Result<Option<Monitor>>

Returns the monitor on which the window currently resides. Read more
source§

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

Returns the primary monitor of the system. Read more
source§

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

Returns the list of all the monitors available on the system.
source§

fn theme(&self) -> Result<Theme>

Returns the current window theme.
source§

fn raw_window_handle(&self) -> Result<RawWindowHandle>

source§

fn center(&self) -> Result<()>

Centers the window.
source§

fn print(&self) -> Result<()>

Opens the dialog to prints the contents of the webview.
source§

fn request_user_attention( &self, request_type: Option<UserAttentionType> ) -> Result<()>

Requests user attention to the window. Read more
source§

fn create_window( &mut self, pending: PendingWindow<T, Self::Runtime> ) -> Result<DetachedWindow<T, Self::Runtime>>

Create a new webview window.
source§

fn set_resizable(&self, resizable: bool) -> Result<()>

Updates the window resizable flag.
source§

fn set_maximizable(&self, maximizable: bool) -> Result<()>

Updates the window’s native maximize button state. Read more
source§

fn set_minimizable(&self, minimizable: bool) -> Result<()>

Updates the window’s native minimize button state. Read more
source§

fn set_closable(&self, closable: bool) -> Result<()>

Updates the window’s native close button state. Read more
source§

fn set_title<S: Into<String>>(&self, title: S) -> Result<()>

Updates the window title.
source§

fn maximize(&self) -> Result<()>

Maximizes the window.
source§

fn unmaximize(&self) -> Result<()>

Unmaximizes the window.
source§

fn minimize(&self) -> Result<()>

Minimizes the window.
source§

fn unminimize(&self) -> Result<()>

Unminimizes the window.
source§

fn show_menu(&self) -> Result<()>

Shows the window menu.
source§

fn hide_menu(&self) -> Result<()>

Hides the window menu.
source§

fn show(&self) -> Result<()>

Shows the window.
source§

fn hide(&self) -> Result<()>

Hides the window.
source§

fn close(&self) -> Result<()>

Closes the window.
source§

fn set_decorations(&self, decorations: bool) -> Result<()>

Updates the hasDecorations flag.
source§

fn set_always_on_top(&self, always_on_top: bool) -> Result<()>

Updates the window alwaysOnTop flag.
source§

fn set_content_protected(&self, protected: bool) -> Result<()>

Prevents the window contents from being captured by other apps.
source§

fn set_size(&self, size: Size) -> Result<()>

Resizes the window.
source§

fn set_min_size(&self, size: Option<Size>) -> Result<()>

Updates the window min size.
source§

fn set_max_size(&self, size: Option<Size>) -> Result<()>

Updates the window max size.
source§

fn set_position(&self, position: Position) -> Result<()>

Updates the window position.
source§

fn set_fullscreen(&self, fullscreen: bool) -> Result<()>

Updates the window fullscreen state.
source§

fn set_focus(&self) -> Result<()>

Bring the window to front and focus.
source§

fn set_icon(&self, icon: Icon) -> Result<()>

Updates the window icon.
source§

fn set_skip_taskbar(&self, skip: bool) -> Result<()>

Whether to hide the window icon from the taskbar or not.
source§

fn set_cursor_grab(&self, grab: bool) -> Result<()>

Grabs the cursor, preventing it from leaving the window. Read more
source§

fn set_cursor_visible(&self, visible: bool) -> Result<()>

Modifies the cursor’s visibility. Read more
source§

fn set_cursor_icon(&self, icon: CursorIcon) -> Result<()>

source§

fn set_cursor_position<Pos: Into<Position>>(&self, position: Pos) -> Result<()>

Changes the position of the cursor in window coordinates.
source§

fn set_ignore_cursor_events(&self, ignore: bool) -> Result<()>

Ignores the window cursor events.
source§

fn start_dragging(&self) -> Result<()>

Starts dragging the window.
source§

fn eval_script<S: Into<String>>(&self, script: S) -> Result<()>

Executes javascript on the window this Dispatch represents.
source§

fn update_menu_item(&self, id: u16, update: MenuUpdate) -> Result<()>

Applies the specified update to the menu item associated with the given id.

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,