Document and implement Debug for EventLoopWindowTarget

This commit is contained in:
Osspial
2018-11-15 16:45:17 -05:00
parent fa46825a28
commit 2a3cefd8c5

View File

@@ -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
@@ -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]