Struct async_winit::event_loop::EventLoopWindowTarget
source · pub struct EventLoopWindowTarget { /* private fields */ }Expand description
A reference to the EventLoop that allows the user access to the underlying display connections.
Unlike in winit, this type is cheaply clonable. It is not actually used that often, since most of
its previous use cases don’t directly require the window target to be passed in. However, it is
still useful for some things, like indicating the need to exit the application or getting
available monitors.
Implementations§
source§impl EventLoopWindowTarget
impl EventLoopWindowTarget
sourcepub fn set_exit_with_code(&self, code: i32)
pub fn set_exit_with_code(&self, code: i32)
Request that we exit as soon as possible with the given exit code.
sourcepub async fn exit_with_code(&self, code: i32) -> !
pub async fn exit_with_code(&self, code: i32) -> !
Exit the program with the given exit code.
sourcepub async fn primary_monitor(&self) -> Option<MonitorHandle>
pub async fn primary_monitor(&self) -> Option<MonitorHandle>
Get the primary monitor.
sourcepub async fn available_monitors(&self) -> impl Iterator<Item = MonitorHandle>
pub async fn available_monitors(&self) -> impl Iterator<Item = MonitorHandle>
Get the available monitors.
sourcepub async fn set_device_event_filter(&self, filter: DeviceEventFilter)
pub async fn set_device_event_filter(&self, filter: DeviceEventFilter)
Set the device event filter.
Trait Implementations§
source§impl Clone for EventLoopWindowTarget
impl Clone for EventLoopWindowTarget
source§impl Debug for EventLoopWindowTarget
impl Debug for EventLoopWindowTarget
source§impl EventLoopWindowTargetExtWayland for EventLoopWindowTarget
impl EventLoopWindowTargetExtWayland for EventLoopWindowTarget
source§fn is_wayland(&self) -> bool
fn is_wayland(&self) -> bool
True if the
EventLoopWindowTarget uses Wayland.source§fn wayland_display(&self) -> Option<*mut c_void>
fn wayland_display(&self) -> Option<*mut c_void>
Returns a pointer to the
wl_display object of wayland that is used by this
EventLoopWindowTarget. Read moresource§impl EventLoopWindowTargetExtX11 for EventLoopWindowTarget
impl EventLoopWindowTargetExtX11 for EventLoopWindowTarget
source§fn is_x11(&self) -> bool
fn is_x11(&self) -> bool
True if the
EventLoopWindowTarget uses X11.