#[non_exhaustive]pub enum Flow {
Continue,
Idle,
Exit,
}Expand description
Whether the game loop should continue or stop after a frame, and whether that frame renders.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Continue
Run another frame, and present it.
Idle
Run another frame, but nothing changed: skip present and leave the
previous frame on screen.
For turn-based apps that only need to redraw in response to player input, not on every
tick of the driver’s loop. Returning Idle while a retroglyph_ui::Tween- or
FrameClock-driven animation is still in flight is an
app bug, not a valid use: an in-progress animation has something new to show every frame,
which is exactly what Idle tells the driver isn’t true.
Exit
Stop the loop. The driver returns and the terminal unwinds normally, so
backend Drop logic (for example crossterm’s terminal restore) runs.
Trait Implementations§
impl Copy for Flow
impl Eq for Flow
impl StructuralPartialEq for Flow
Auto Trait Implementations§
impl Freeze for Flow
impl RefUnwindSafe for Flow
impl Send for Flow
impl Sync for Flow
impl Unpin for Flow
impl UnsafeUnpin for Flow
impl UnwindSafe for Flow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<C> WithAlpha for Cwhere
C: Copy,
impl<C> WithAlpha for Cwhere
C: Copy,
§fn with_alpha_first<A>(self, alpha: A) -> AlphaFirst<A, Self>
fn with_alpha_first<A>(self, alpha: A) -> AlphaFirst<A, Self>
Wraps
self with alpha, storing alpha before the color in memory
(see [AlphaFirst]).§fn with_alpha_last<A>(self, alpha: A) -> AlphaLast<A, Self>
fn with_alpha_last<A>(self, alpha: A) -> AlphaLast<A, Self>
Wraps
self with alpha, storing alpha after the color in memory
(see [AlphaLast]).