pub enum BarMotion {
Bounce,
Loop,
}Expand description
Controls how the arc behaves when it reaches the edge of the bar.
| Variant | Behaviour |
|---|---|
Bounce | Reverses at each edge — classic ping-pong (default) |
Loop | Wraps around: when the arc exits one edge it re-enters from the other |
Combined with Spin, Loop produces a continuous sweep:
Spin::Clockwise+Loop→ sweeps left → right endlesslySpin::CounterClockwise+Loop→ sweeps right → left endlessly
§Examples
use tui_spinner::{BarSpinner, BarMotion, Spin};
// Default ping-pong
let bounce = BarSpinner::new(0).motion(BarMotion::Bounce);
// Continuous left-to-right sweep
let sweep = BarSpinner::new(0).spin(Spin::Clockwise).motion(BarMotion::Loop);Variants§
Bounce
Reverse at each edge — ping-pong (default).
Loop
Wrap around: exit one edge and re-enter from the other.
Trait Implementations§
impl Copy for BarMotion
impl Eq for BarMotion
impl StructuralPartialEq for BarMotion
Auto Trait Implementations§
impl Freeze for BarMotion
impl RefUnwindSafe for BarMotion
impl Send for BarMotion
impl Sync for BarMotion
impl Unpin for BarMotion
impl UnsafeUnpin for BarMotion
impl UnwindSafe for BarMotion
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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