pub trait HeadlessAppWindowExt {
// Required methods
fn open_window<F>(
&mut self,
new_window: impl IntoFuture<IntoFuture = F>,
) -> WindowId
where F: Future<Output = WindowRoot> + Send + 'static;
fn focus_window(&mut self, window_id: WindowId);
fn blur_window(&mut self, window_id: WindowId);
fn window_frame_image(
&mut self,
window_id: WindowId,
mask: Option<ImageMaskMode>,
) -> ImageVar;
fn close_window(&mut self, window_id: WindowId) -> bool;
fn run_window<F>(&mut self, 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,
new_window: impl IntoFuture<IntoFuture = F>,
) -> WindowId
fn open_window<F>( &mut self, new_window: impl IntoFuture<IntoFuture = F>, ) -> WindowId
sourcefn focus_window(&mut self, window_id: WindowId)
fn focus_window(&mut self, window_id: WindowId)
Cause the headless window to think it is focused in the screen.
sourcefn blur_window(&mut self, window_id: WindowId)
fn blur_window(&mut self, window_id: WindowId)
Cause the headless window to think focus moved away from it.
sourcefn window_frame_image(
&mut self,
window_id: WindowId,
mask: Option<ImageMaskMode>,
) -> ImageVar
fn window_frame_image( &mut self, window_id: 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: WindowId) -> bool
fn close_window(&mut self, window_id: WindowId) -> bool
Sends a close request.
Returns if the window was found and closed.
sourcefn run_window<F>(&mut self, new_window: impl IntoFuture<IntoFuture = F>)
fn run_window<F>(&mut self, 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.
Object Safety§
This trait is not object safe.