pub struct SpinnerState {
pub frame: usize,
pub active: bool,
/* private fields */
}Expand description
State for the spinner animation
Fields§
§frame: usizeCurrent frame index
active: boolWhether the spinner is active
Implementations§
Source§impl SpinnerState
impl SpinnerState
Sourcepub fn with_interval(interval_ms: u64) -> Self
pub fn with_interval(interval_ms: u64) -> Self
Create a new spinner state with a specific interval
Sourcepub fn for_frames(frames: SpinnerFrames) -> Self
pub fn for_frames(frames: SpinnerFrames) -> Self
Create a new spinner state configured for specific frames
Sourcepub fn set_interval(&mut self, interval_ms: u64)
pub fn set_interval(&mut self, interval_ms: u64)
Set the frame interval
Sourcepub fn tick(&mut self) -> bool
pub fn tick(&mut self) -> bool
Advance to the next frame if enough time has passed
Returns true if the frame changed
Sourcepub fn tick_with_frames(&mut self, frame_count: usize) -> bool
pub fn tick_with_frames(&mut self, frame_count: usize) -> bool
Advance to the next frame with a specific frame count
Returns true if the frame changed
Sourcepub fn next_frame(&mut self, frame_count: usize)
pub fn next_frame(&mut self, frame_count: usize)
Force advance to the next frame
Trait Implementations§
Source§impl Clone for SpinnerState
impl Clone for SpinnerState
Source§fn clone(&self) -> SpinnerState
fn clone(&self) -> SpinnerState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpinnerState
impl Debug for SpinnerState
Auto Trait Implementations§
impl Freeze for SpinnerState
impl RefUnwindSafe for SpinnerState
impl Send for SpinnerState
impl Sync for SpinnerState
impl Unpin for SpinnerState
impl UnwindSafe for SpinnerState
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,
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