@@ -275,7 +275,7 @@ impl AsFd for EventLoop {
275275 ///
276276 /// [`calloop`]: https://crates.io/crates/calloop
277277 /// [`mio`]: https://crates.io/crates/mio
278- /// [`pump_app_events`]: crate::platform ::pump_events::EventLoopExtPumpEvents::pump_app_events
278+ /// [`pump_app_events`]: crate::event_loop ::pump_events::EventLoopExtPumpEvents::pump_app_events
279279 fn as_fd ( & self ) -> BorrowedFd < ' _ > {
280280 self . event_loop . as_fd ( )
281281 }
@@ -289,8 +289,54 @@ impl AsRawFd for EventLoop {
289289 ///
290290 /// [`calloop`]: https://crates.io/crates/calloop
291291 /// [`mio`]: https://crates.io/crates/mio
292- /// [`pump_app_events`]: crate::platform ::pump_events::EventLoopExtPumpEvents::pump_app_events
292+ /// [`pump_app_events`]: crate::event_loop ::pump_events::EventLoopExtPumpEvents::pump_app_events
293293 fn as_raw_fd ( & self ) -> RawFd {
294294 self . event_loop . as_raw_fd ( )
295295 }
296296}
297+
298+ #[ cfg( any(
299+ windows_platform,
300+ macos_platform,
301+ android_platform,
302+ x11_platform,
303+ wayland_platform,
304+ docsrs,
305+ ) ) ]
306+ impl winit_core:: event_loop:: pump_events:: EventLoopExtPumpEvents for EventLoop {
307+ fn pump_app_events < A : ApplicationHandler > (
308+ & mut self ,
309+ timeout : Option < std:: time:: Duration > ,
310+ app : A ,
311+ ) -> winit_core:: event_loop:: pump_events:: PumpStatus {
312+ self . event_loop . pump_app_events ( timeout, app)
313+ }
314+ }
315+
316+ #[ allow( unused_imports) ]
317+ #[ cfg( any(
318+ windows_platform,
319+ macos_platform,
320+ android_platform,
321+ x11_platform,
322+ wayland_platform,
323+ docsrs,
324+ ) ) ]
325+ impl winit_core:: event_loop:: run_on_demand:: EventLoopExtRunOnDemand for EventLoop {
326+ fn run_app_on_demand < A : ApplicationHandler > ( & mut self , app : A ) -> Result < ( ) , EventLoopError > {
327+ self . event_loop . run_app_on_demand ( app)
328+ }
329+ }
330+
331+ /// ```compile_error
332+ /// use winit::event_loop::run_on_demand::EventLoopExtRunOnDemand;
333+ /// use winit::event_loop::EventLoop;
334+ ///
335+ /// let mut event_loop = EventLoop::new().unwrap();
336+ /// event_loop.run_app_on_demand(|_, _| {
337+ /// // Attempt to run the event loop re-entrantly; this must fail.
338+ /// event_loop.run_app_on_demand(|_, _| {});
339+ /// });
340+ /// ```
341+ #[ allow( dead_code) ]
342+ fn test_run_on_demand_cannot_access_event_loop ( ) { }
0 commit comments