pub struct EventLoopHandle { /* private fields */ }Expand description
Handle for sending requests to the main event loop and receiving responses.
Implementations§
Source§impl EventLoopHandle
impl EventLoopHandle
Sourcepub fn available_monitors(&self) -> Vec<MonitorHandle>
pub fn available_monitors(&self) -> Vec<MonitorHandle>
The list of all monitors available on the system.
Equivalent to
winit::event_loop::EventLoopWindowTarget::available_monitors.
Sourcepub fn primary_monitor(&self) -> Option<MonitorHandle>
pub fn primary_monitor(&self) -> Option<MonitorHandle>
The primary monitor of the system.
Equivalent to
winit::event_loop::EventLoopWindowTarget::primary_monitor.
Sourcepub fn create_window(
&self,
attributes: WindowAttributes,
) -> Result<Window, OsError>
pub fn create_window( &self, attributes: WindowAttributes, ) -> Result<Window, OsError>
Attempt to create a new window.
Equivalent to winit::window::WindowBuilder::build.
Examples found in repository?
examples/winit_readme.rs (line 38)
35fn main() {
36 winit_main::run(|event_loop, events| {
37 let window = event_loop
38 .create_window(WindowAttributes::default())
39 .unwrap();
40
41 for event in events.iter() {
42 if matches!(
43 event,
44 Event::WindowEvent {
45 event: WindowEvent::CloseRequested,
46 window_id,
47 } if window_id == window.id()
48 ) {
49 break;
50 }
51 }
52 });
53}Trait Implementations§
Source§impl Clone for EventLoopHandle
impl Clone for EventLoopHandle
Source§fn clone(&self) -> EventLoopHandle
fn clone(&self) -> EventLoopHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EventLoopHandle
impl !RefUnwindSafe for EventLoopHandle
impl Send for EventLoopHandle
impl Sync for EventLoopHandle
impl Unpin for EventLoopHandle
impl !UnwindSafe for EventLoopHandle
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