Improve docs for run and run_return

This commit is contained in:
Osspial
2018-08-23 20:13:53 -04:00
parent fba41f7a7e
commit 0f34408763
2 changed files with 5 additions and 4 deletions

View File

@@ -105,8 +105,9 @@ impl<T> EventLoop<T> {
MonitorId { inner: self.events_loop.get_primary_monitor() }
}
/// Hijacks the calling thread and initializes the `winit` event loop. Can take a
/// `FnMut(Event, &EventLoop) -> ControlFlow` or a custom `EventHandler` type.
/// Hijacks the calling thread and initializes the `winit` event loop with the provided
/// closure. Since the closure is `'static`, it must be a `move` closure if it needs to
/// access any data from the calling context.
///
/// Any values not passed to this function will *not* be dropped.
#[inline]

View File

@@ -14,8 +14,8 @@ pub trait EventLoopExtDesktop {
/// Initializes the `winit` event loop.
///
/// Unlikes `run`, this function accepts non-`'static` closures and returns control flow to the
/// caller when `control_flow` is set to `ControlFlow::Exit`.
/// Unlikes `run`, this function accepts non-`'static` (i.e. non-`move`) closures and returns
/// control flow to the caller when `control_flow` is set to `ControlFlow::Exit`.
fn run_return<F>(&mut self, event_handler: F)
where F: FnMut(Event<Self::UserEvent>, &EventLoop<Self::UserEvent>, &mut ControlFlow);
}