pub struct DisplayObserver { /* private fields */ }Expand description
A display observer that monitors changes to the display configuration.
§Platform-specifics
- Windows: Internally creates an invisible window to receive
WM_DISPLAYCHANGEevents. - macOS: Uses
CGDisplayRegisterReconfigurationCallbackto track display configuration changes.
Implementations§
Source§impl DisplayObserver
impl DisplayObserver
Sourcepub fn set_callback<F>(&self, callback: F)
pub fn set_callback<F>(&self, callback: F)
Sets the callback function to be invoked when a display event occurs.
Sourcepub fn remove_callback(&self)
pub fn remove_callback(&self)
Removes the currently set callback function. After calling this, no display events will be dispatched.
Auto Trait Implementations§
impl Freeze for DisplayObserver
impl RefUnwindSafe for DisplayObserver
impl !Send for DisplayObserver
impl !Sync for DisplayObserver
impl Unpin for DisplayObserver
impl UnwindSafe for DisplayObserver
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