mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
Add timeout argument to pump_events
This renames all internal implementations of pump_events_with_timeout to pump_events and makes them public. Since all platforms that support pump_events support timeouts there's no need to have a separate API.
This commit is contained in:
committed by
Kirill Chibisov
parent
e6c7cc297d
commit
ae9b02e097
@@ -291,14 +291,7 @@ impl<T> EventLoop<T> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pump_events<F>(&mut self, callback: F) -> PumpStatus
|
||||
where
|
||||
F: FnMut(Event<'_, T>, &RootWindowTarget<T>, &mut ControlFlow),
|
||||
{
|
||||
self.pump_events_with_timeout(Some(Duration::ZERO), callback)
|
||||
}
|
||||
|
||||
fn pump_events_with_timeout<F>(&mut self, timeout: Option<Duration>, callback: F) -> PumpStatus
|
||||
pub fn pump_events<F>(&mut self, timeout: Option<Duration>, callback: F) -> PumpStatus
|
||||
where
|
||||
F: FnMut(Event<'_, T>, &RootWindowTarget<T>, &mut ControlFlow),
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user