mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-28 07:33:14 -04:00
Improve docs for run and run_return
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user