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>,
) -> ReadOnlyVar<Img, ArcVar<Img>>;
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>,
) -> ReadOnlyVar<Img, ArcVar<Img>>
fn window_frame_image( &mut self, window_id: WindowId, mask: Option<ImageMaskMode>, ) -> ReadOnlyVar<Img, ArcVar<Img>>
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.
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.