Skip to content

Commit

Permalink
Document and implement Debug for EventLoopWindowTarget
Browse files Browse the repository at this point in the history
  • Loading branch information
Osspial committed Nov 15, 2018
1 parent fa46825 commit 2a3cefd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ pub struct EventLoop<T: 'static> {
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<T: 'static> {
pub(crate) p: platform_impl::EventLoopWindowTarget<T>,
pub(crate) _marker: ::std::marker::PhantomData<*mut ()> // Not Send nor Sync
Expand All @@ -46,6 +51,12 @@ impl<T> fmt::Debug for EventLoop<T> {
}
}

impl<T> fmt::Debug for EventLoopWindowTarget<T> {
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]
Expand Down

0 comments on commit 2a3cefd

Please sign in to comment.