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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.