HeadlessAppWindowExt

Trait HeadlessAppWindowExt 

Source
pub trait HeadlessAppWindowExt {
    // Required methods
    fn open_window<F>(
        &mut self,
        window_id: impl Into<WindowId>,
        new_window: impl IntoFuture<IntoFuture = F>,
    ) -> WindowVars
       where F: Future<Output = WindowRoot> + Send + 'static;
    fn focus_window(&mut self, window_id: impl Into<WindowId>);
    fn blur_window(&mut self, window_id: impl Into<WindowId>);
    fn window_frame_image(
        &mut self,
        window_id: impl Into<WindowId>,
        mask: Option<ImageMaskMode>,
    ) -> ImageVar;
    fn close_window(&mut self, window_id: impl Into<WindowId>) -> bool;
    fn run_window<F>(
        &mut self,
        window_id: impl Into<WindowId>,
        new_window: impl IntoFuture<IntoFuture = F>,
    )
       where F: Send + Future<Output = WindowRoot> + 'static;
    fn doc_test_window<F>(
        &mut self,
        new_window: impl IntoFuture<IntoFuture = F>,
    )
       where F: Future<Output = WindowRoot> + 'static + Send;
}
Expand description

Window extension methods for HeadlessApp.

Required Methods§

Source

fn open_window<F>( &mut self, window_id: impl Into<WindowId>, new_window: impl IntoFuture<IntoFuture = F>, ) -> WindowVars
where F: Future<Output = WindowRoot> + Send + 'static,

Open a new headless window and returns the new window ID.

The new_window runs inside the WINDOW context of the new window.

Returns the WindowVars of the new window after the window is open and loaded.

Source

fn focus_window(&mut self, window_id: impl Into<WindowId>)

Cause the headless window to think it is focused in the screen.

Source

fn blur_window(&mut self, window_id: impl Into<WindowId>)

Cause the headless window to think focus moved away from it.

Source

fn window_frame_image( &mut self, window_id: impl Into<WindowId>, mask: Option<ImageMaskMode>, ) -> ImageVar

Copy the current frame pixels of the window.

The var will update until the image is loaded or error.

Source

fn close_window(&mut self, window_id: impl Into<WindowId>) -> bool

Sends a close request.

Returns if the window was found and closed.

Source

fn run_window<F>( &mut self, window_id: impl Into<WindowId>, new_window: impl IntoFuture<IntoFuture = F>, )
where F: Send + Future<Output = WindowRoot> + 'static,

Open a new headless window and update the app until the window closes.

Source

fn doc_test_window<F>(&mut self, new_window: impl IntoFuture<IntoFuture = F>)
where F: Future<Output = WindowRoot> + 'static + Send,

Open a new headless window and update the app until the window closes or 60 seconds elapse.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl HeadlessAppWindowExt for HeadlessApp

Source§

fn open_window<F>( &mut self, window_id: impl Into<WindowId>, new_window: impl IntoFuture<IntoFuture = F>, ) -> WindowVars
where F: Future<Output = WindowRoot> + Send + 'static,

Source§

fn focus_window(&mut self, window_id: impl Into<WindowId>)

Source§

fn blur_window(&mut self, window_id: impl Into<WindowId>)

Source§

fn window_frame_image( &mut self, window_id: impl Into<WindowId>, mask: Option<ImageMaskMode>, ) -> ImageVar

Source§

fn close_window(&mut self, window_id: impl Into<WindowId>) -> bool

Source§

fn run_window<F>( &mut self, window_id: impl Into<WindowId>, new_window: impl IntoFuture<IntoFuture = F>, )
where F: Future<Output = WindowRoot> + Send + 'static,

Source§

fn doc_test_window<F>(&mut self, new_window: impl IntoFuture<IntoFuture = F>)
where F: Future<Output = WindowRoot> + Send + 'static,

Implementors§