pub enum WindowEvent {
CloseRequested,
Resized(Size),
Moved(Point),
ScaleFactorChanged {
scale_factor: f64,
raw_dpi: Option<f32>,
suggested_size: Option<Size>,
},
SafeAreaChanged(SafeAreaInsets),
Focused(bool),
Occluded(bool),
ExternalFileHovered(PathBuf),
ExternalFileHoverCancelled,
ExternalFileDropped(PathBuf),
RedrawRequested,
}Variants§
CloseRequested
The host target should close. The target is identified by the
WindowId attached to the delivery path rather than by this event.
Resized(Size)
The host target’s viewport changed size. The target may be a native window or an embedded viewport/region.
Moved(Point)
The native desktop window moved to a new physical desktop position. Embedded and web hosts may never emit this event.
ScaleFactorChanged
SafeAreaChanged(SafeAreaInsets)
The unobscured inset from each viewport edge changed, usually after a mobile rotation, browser viewport update, or host embedding change.
Focused(bool)
Occluded(bool)
ExternalFileHovered(PathBuf)
A file from outside the application is being hovered over the host window. Platforms emit one event per file when several files are dragged together.
ExternalFileHoverCancelled
Files from outside the application left the host window without being dropped.
ExternalFileDropped(PathBuf)
A file from outside the application was dropped on the host window. Platforms emit one event per file when several files are dropped together.
RedrawRequested
Trait Implementations§
Source§impl Clone for WindowEvent
impl Clone for WindowEvent
Source§fn clone(&self) -> WindowEvent
fn clone(&self) -> WindowEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WindowEvent
impl Debug for WindowEvent
Source§impl PartialEq for WindowEvent
impl PartialEq for WindowEvent
impl StructuralPartialEq for WindowEvent
Auto Trait Implementations§
impl Freeze for WindowEvent
impl RefUnwindSafe for WindowEvent
impl Send for WindowEvent
impl Sync for WindowEvent
impl Unpin for WindowEvent
impl UnsafeUnpin for WindowEvent
impl UnwindSafe for WindowEvent
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.