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§
Sourcefn open_window<F>(
&mut self,
window_id: impl Into<WindowId>,
new_window: impl IntoFuture<IntoFuture = F>,
) -> WindowVars
fn open_window<F>( &mut self, window_id: impl Into<WindowId>, new_window: impl IntoFuture<IntoFuture = F>, ) -> WindowVars
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.
Sourcefn focus_window(&mut self, window_id: impl Into<WindowId>)
fn focus_window(&mut self, window_id: impl Into<WindowId>)
Cause the headless window to think it is focused in the screen.
Sourcefn blur_window(&mut self, window_id: impl Into<WindowId>)
fn blur_window(&mut self, window_id: impl Into<WindowId>)
Cause the headless window to think focus moved away from it.
Sourcefn window_frame_image(
&mut self,
window_id: impl Into<WindowId>,
mask: Option<ImageMaskMode>,
) -> ImageVar
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.
Sourcefn close_window(&mut self, window_id: impl Into<WindowId>) -> bool
fn close_window(&mut self, window_id: impl Into<WindowId>) -> bool
Sends a close request.
Returns if the window was found and closed.
Sourcefn run_window<F>(
&mut self,
window_id: impl Into<WindowId>,
new_window: impl IntoFuture<IntoFuture = F>,
)
fn run_window<F>( &mut self, window_id: impl Into<WindowId>, new_window: impl IntoFuture<IntoFuture = F>, )
Open a new headless window and update the app until the window closes.
Sourcefn doc_test_window<F>(&mut self, new_window: impl IntoFuture<IntoFuture = F>)
fn doc_test_window<F>(&mut self, new_window: impl IntoFuture<IntoFuture = F>)
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.