From 2a3cefd8c5df1c06127b05651cbdf5e3d9e3a6d3 Mon Sep 17 00:00:00 2001 From: Osspial Date: Thu, 15 Nov 2018 16:45:17 -0500 Subject: [PATCH] Document and implement Debug for EventLoopWindowTarget --- src/event_loop.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/event_loop.rs b/src/event_loop.rs index 174d30089..ca217f7c9 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]