mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-02 14:50:04 -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() }
|
MonitorId { inner: self.events_loop.get_primary_monitor() }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Hijacks the calling thread and initializes the `winit` event loop. Can take a
|
/// Hijacks the calling thread and initializes the `winit` event loop with the provided
|
||||||
/// `FnMut(Event, &EventLoop) -> ControlFlow` or a custom `EventHandler` type.
|
/// 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.
|
/// Any values not passed to this function will *not* be dropped.
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ pub trait EventLoopExtDesktop {
|
|||||||
|
|
||||||
/// Initializes the `winit` event loop.
|
/// Initializes the `winit` event loop.
|
||||||
///
|
///
|
||||||
/// Unlikes `run`, this function accepts non-`'static` closures and returns control flow to the
|
/// Unlikes `run`, this function accepts non-`'static` (i.e. non-`move`) closures and returns
|
||||||
/// caller when `control_flow` is set to `ControlFlow::Exit`.
|
/// control flow to the caller when `control_flow` is set to `ControlFlow::Exit`.
|
||||||
fn run_return<F>(&mut self, event_handler: F)
|
fn run_return<F>(&mut self, event_handler: F)
|
||||||
where F: FnMut(Event<Self::UserEvent>, &EventLoop<Self::UserEvent>, &mut ControlFlow);
|
where F: FnMut(Event<Self::UserEvent>, &EventLoop<Self::UserEvent>, &mut ControlFlow);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user