pub struct EventLoopWindowTarget<TS: ThreadSafety = DefaultThreadSafety> { /* 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<TS: ThreadSafety> EventLoopWindowTarget<TS>
impl<TS: ThreadSafety> EventLoopWindowTarget<TS>
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<TS: ThreadSafety> Clone for EventLoopWindowTarget<TS>
impl<TS: ThreadSafety> Clone for EventLoopWindowTarget<TS>
Source§impl<TS: ThreadSafety> Debug for EventLoopWindowTarget<TS>
impl<TS: ThreadSafety> Debug for EventLoopWindowTarget<TS>
Source§impl<TS: ThreadSafety> HasRawDisplayHandle for EventLoopWindowTarget<TS>
impl<TS: ThreadSafety> HasRawDisplayHandle for EventLoopWindowTarget<TS>
fn raw_display_handle(&self) -> RawDisplayHandle
Auto Trait Implementations§
impl<TS> Freeze for EventLoopWindowTarget<TS>where
<TS as __ThreadSafety>::Rc<Reactor<TS>>: Freeze,
impl<TS> RefUnwindSafe for EventLoopWindowTarget<TS>where
<TS as __ThreadSafety>::Rc<Reactor<TS>>: RefUnwindSafe,
impl<TS = ThreadUnsafe> !Send for EventLoopWindowTarget<TS>
impl<TS = ThreadUnsafe> !Sync for EventLoopWindowTarget<TS>
impl<TS> Unpin for EventLoopWindowTarget<TS>where
<TS as __ThreadSafety>::Rc<Reactor<TS>>: Unpin,
impl<TS> UnwindSafe for EventLoopWindowTarget<TS>where
<TS as __ThreadSafety>::Rc<Reactor<TS>>: UnwindSafe,
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