pub struct WindowHandle { /* private fields */ }Expand description
Sendable handle that queues commands and wakes the native UI loop.
Implementations§
Source§impl WindowHandle
impl WindowHandle
Sourcepub fn set_wakeup<F>(&self, wakeup: F)
pub fn set_wakeup<F>(&self, wakeup: F)
Install the backend wakeup callback.
Installing a callback while commands are queued schedules one wakeup. The callback is always invoked after releasing the queue lock.
Sourcepub fn drain_commands(&self) -> Vec<WindowCommand>
pub fn drain_commands(&self) -> Vec<WindowCommand>
Drain queued commands on the UI thread.
Sourcepub fn send(&self, command: WindowCommand) -> Result<(), WindowCommandError>
pub fn send(&self, command: WindowCommand) -> Result<(), WindowCommandError>
Queue a native command.
Success means the command was accepted into the bounded queue, not that the native UI thread has already applied it.
Sourcepub fn set_title(
&self,
title: impl Into<String>,
) -> Result<(), WindowCommandError>
pub fn set_title( &self, title: impl Into<String>, ) -> Result<(), WindowCommandError>
Queue title update.
Sourcepub fn set_background(&self, color: Rgba) -> Result<(), WindowCommandError>
pub fn set_background(&self, color: Rgba) -> Result<(), WindowCommandError>
Queue a native and document background update without changing the bundle manifest.
Sourcepub fn set_size(
&self,
width: u32,
height: u32,
) -> Result<(), WindowCommandError>
pub fn set_size( &self, width: u32, height: u32, ) -> Result<(), WindowCommandError>
Queue size update.
Sourcepub fn minimize(&self) -> Result<(), WindowCommandError>
pub fn minimize(&self) -> Result<(), WindowCommandError>
Queue minimization.
Sourcepub fn maximize(&self) -> Result<(), WindowCommandError>
pub fn maximize(&self) -> Result<(), WindowCommandError>
Queue maximization.
Sourcepub fn unmaximize(&self) -> Result<(), WindowCommandError>
pub fn unmaximize(&self) -> Result<(), WindowCommandError>
Queue unmaximization.
Sourcepub fn fullscreen(&self, value: bool) -> Result<(), WindowCommandError>
pub fn fullscreen(&self, value: bool) -> Result<(), WindowCommandError>
Queue fullscreen change.
Sourcepub fn center(&self) -> Result<(), WindowCommandError>
pub fn center(&self) -> Result<(), WindowCommandError>
Queue centering.
Sourcepub fn focus(&self) -> Result<(), WindowCommandError>
pub fn focus(&self) -> Result<(), WindowCommandError>
Queue focus.
Sourcepub fn request_close(&self) -> Result<(), WindowCommandError>
pub fn request_close(&self) -> Result<(), WindowCommandError>
Queue a native close request.
Sourcepub fn start_drag(&self) -> Result<(), WindowCommandError>
pub fn start_drag(&self) -> Result<(), WindowCommandError>
Queue native drag.
Sourcepub fn set_always_on_top(&self, value: bool) -> Result<(), WindowCommandError>
pub fn set_always_on_top(&self, value: bool) -> Result<(), WindowCommandError>
Queue always-on-top change.
Trait Implementations§
Source§impl Clone for WindowHandle
impl Clone for WindowHandle
Auto Trait Implementations§
impl Freeze for WindowHandle
impl RefUnwindSafe for WindowHandle
impl Send for WindowHandle
impl Sync for WindowHandle
impl Unpin for WindowHandle
impl UnsafeUnpin for WindowHandle
impl UnwindSafe for WindowHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more