pub enum LinearStyle {
Classic,
Square,
Diamond,
Bar,
Braille,
Arrow,
}Expand description
The symbol pair used to draw active and inactive slot positions.
Each variant defines an (active, inactive) character pair rendered with
bold + active_color / inactive_color respectively.
§Examples
use tui_spinner::{LinearSpinner, LinearStyle};
let spinner = LinearSpinner::new(0).linear_style(LinearStyle::Diamond);Variants§
Classic
● / · — filled circle / middle dot. The original classic look.
Square
■ / □ — filled square / open square.
Diamond
◆ / ◇ — filled diamond / open diamond.
Bar
▰ / ▱ — parallelogram filled / parallelogram empty.
Braille
⣿ / ⠀ — full braille cell / blank braille cell.
Arrow
▶ / ▷ — filled right-arrow / open right-arrow.
Rotates to ▼ / ▽ when Direction::Vertical is used.
Implementations§
Source§impl LinearStyle
impl LinearStyle
Sourcepub const fn symbols(self, direction: Direction) -> (&'static str, &'static str)
pub const fn symbols(self, direction: Direction) -> (&'static str, &'static str)
Returns the (active, inactive) string pair for this style,
optionally adjusted for the given direction.
Sourcepub const fn columns_per_slot(self) -> u16
pub const fn columns_per_slot(self) -> u16
Returns the number of terminal columns each slot occupies.
Most symbols are 1 column wide in a typical Western terminal.
Symbols whose Unicode East Asian Width property is “Wide” occupy 2
columns; callers that lay out the spinner area manually (e.g. in
a Ratatui Layout) should multiply total_slots by this value
to get the correct Constraint::Length value.
§Examples
use tui_spinner::{Direction, LinearStyle};
// Allocate exactly the right width for a 5-slot horizontal spinner:
let style = LinearStyle::Classic;
let width = 5 * style.columns_per_slot();
assert_eq!(width, 5);Trait Implementations§
Source§impl Clone for LinearStyle
impl Clone for LinearStyle
Source§fn clone(&self) -> LinearStyle
fn clone(&self) -> LinearStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LinearStyle
impl Debug for LinearStyle
Source§impl Default for LinearStyle
impl Default for LinearStyle
Source§fn default() -> LinearStyle
fn default() -> LinearStyle
Source§impl PartialEq for LinearStyle
impl PartialEq for LinearStyle
impl Copy for LinearStyle
impl Eq for LinearStyle
impl StructuralPartialEq for LinearStyle
Auto Trait Implementations§
impl Freeze for LinearStyle
impl RefUnwindSafe for LinearStyle
impl Send for LinearStyle
impl Sync for LinearStyle
impl Unpin for LinearStyle
impl UnsafeUnpin for LinearStyle
impl UnwindSafe for LinearStyle
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
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
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>
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>
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