#[non_exhaustive]pub enum Event {
Created,
Resized,
Moved,
Foregrounded,
Backgrounded,
Focused,
Unfocused,
Hidden,
Showed,
Closed {
window_id: WindowId,
},
}Expand description
Represents events that can be observed on a window.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Created
The window was created.
Resized
The window was resized.
Moved
The window was moved.
Foregrounded
The window was brought to the foreground. This event does not mean the window has gained input focus.
Backgrounded
The window was backgrounded. It is opposite of Event::Foregrounded.
Focused
The window was focused.
§Platform-specific
- Windows: This event is same as
Event::Foregrounded. So this event andForegroundedevent are always dispatched together. - macOS: On macOS, a window does not lose focus even when miniaturized. Therefore, this event will not be dispatched when the window is deminiaturized.
Unfocused
The window was unfocused.
§Platform-specific
- Windows: This event is same as
Event::Backgrounded. So this event andBackgroundedevent are always dispatched together. - macOS: On macOS, a window does not lose focus even when miniaturized. Therefore, this event will not be dispatched when the window is miniaturized
Hidden
The window was hidden.
Showed
The window was showed.
§Platform-specific
- Windows: This event may not occur until after the observer has started and the first Hidden event has been triggered. Example: When monitoring begins while the window is minimized to the taskbar, and then the window is opened from the taskbar.
Closed
The window was closed.
Trait Implementations§
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
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