pub struct EdgeSnake {
pub x: u16,
pub y: u16,
last_update: Instant,
frame_duration: Duration,
}Expand description
Manages the welcome-screen snake moving across the top row.
Fields§
§x: u16Current horizontal position of the head.
y: u16Kept at the top row; exposed for compatibility with the menu renderer.
last_update: InstantLast update timestamp for frame rate control.
frame_duration: DurationTarget duration between animation frames (speed).
Implementations§
Source§impl EdgeSnake
impl EdgeSnake
Sourcepub fn update(&mut self, area: &Rect)
pub fn update(&mut self, area: &Rect)
Moves the snake one cell to the right on the top row, wrapping at the opposite edge.
pub fn render(&self, frame: &mut Frame<'_>, area: &Rect)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EdgeSnake
impl RefUnwindSafe for EdgeSnake
impl Send for EdgeSnake
impl Sync for EdgeSnake
impl Unpin for EdgeSnake
impl UnsafeUnpin for EdgeSnake
impl UnwindSafe for EdgeSnake
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more