diff --git a/src/event_loop.rs b/src/event_loop.rs index 174d300891..ca217f7c97 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -35,6 +35,11 @@ pub struct EventLoop { pub(crate) _marker: ::std::marker::PhantomData<*mut ()> // Not Send nor Sync } +/// Target that associates windows with an `EventLoop`. +/// +/// This type exists to allow you to create new windows while Winit executes your callback. +/// `EventLoop` will coerce into this type, so functions that take this as a parameter can also +/// take `&EventLoop`. pub struct EventLoopWindowTarget { pub(crate) p: platform_impl::EventLoopWindowTarget, pub(crate) _marker: ::std::marker::PhantomData<*mut ()> // Not Send nor Sync @@ -46,6 +51,12 @@ impl fmt::Debug for EventLoop { } } +impl fmt::Debug for EventLoopWindowTarget { + fn fmt(&self, fmtr: &mut fmt::Formatter) -> fmt::Result { + fmtr.pad("EventLoopWindowTarget { .. }") + } +} + /// Set by the user callback given to the `EventLoop::run` method. /// /// Indicates the desired behavior of the event loop after [`Event::EventsCleared`][events_cleared]