Enum winit_modular::event_loop::ControlFlow
source · [−]pub enum ControlFlow {
Poll,
Wait,
WaitUntil(Instant),
ExitLocal,
ExitApp,
}Expand description
winit::event_loop::ControlFlow for a proxy event loop.
Copied from winit/event_loop and modified. See winit::event_loop::ControlFlow docs for details.
Like winit/event_loop, the default is [Poll], but if you set the value it will persist in future
calls to the event handler until you set it again.
[Wait] and [WaitLocal] are supported, but they will only actually do anything if all proxies are waiting. Otherwise you will continue to receive events as normal, so be aware.
Setting to [ExitLocal] causes the current call to [EventLoopProxy::run] or associated methods to exit, while setting to [ExitApp] causes the entire application (including all other event loops) to exit.
Defaults to [Poll].
Variants
Poll
When the current loop iteration finishes, immediately begin a new iteration regardless of whether or not new events are available to process.
Wait
When the current loop iteration finishes, suspend the thread until another event arrives, if all other proxies are waiting.
WaitUntil(Instant)
When the current loop iteration finishes, suspend the thread until either another event arrives, the given time is reached, or another proxy is receiving events.
Can be useful for implementing timers but make sure the instant is actually reached because of the “other proxies” policy.
ExitLocal
Stop this proxy and exit the corresponding [ProxyEventLoop::run] method this event handler was registered for.
ExitApp
Send a [winit::events::LoopDestroyed] event and stop the event loop, stopping all other proxies.
Trait Implementations
sourceimpl Clone for ControlFlow
impl Clone for ControlFlow
sourcefn clone(&self) -> ControlFlow
fn clone(&self) -> ControlFlow
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ControlFlow
impl Debug for ControlFlow
sourceimpl Default for ControlFlow
impl Default for ControlFlow
sourceimpl PartialEq<ControlFlow> for ControlFlow
impl PartialEq<ControlFlow> for ControlFlow
sourcefn eq(&self, other: &ControlFlow) -> bool
fn eq(&self, other: &ControlFlow) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ControlFlow) -> bool
fn ne(&self, other: &ControlFlow) -> bool
This method tests for !=.
impl Copy for ControlFlow
impl Eq for ControlFlow
impl StructuralEq for ControlFlow
impl StructuralPartialEq for ControlFlow
Auto Trait Implementations
impl RefUnwindSafe for ControlFlow
impl Send for ControlFlow
impl Sync for ControlFlow
impl Unpin for ControlFlow
impl UnwindSafe for ControlFlow
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more