### Run the demo example Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/lib.rs.html Runs the demo example with all available symbols. Use this to see the throbber widget in action. ```sh cargo run --example demo --release ``` -------------------------------- ### calc_step example Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.ThrobberState.html Example for the calc_step method. It shows that positive steps increase the index, negative steps decrease it, and a step of 0 results in a random index within the i8 range. ```rust let mut throbber_state = throbber_widgets_tui::ThrobberState::default(); assert_eq!(throbber_state.index(), 0); throbber_state.calc_step(2); assert_eq!(throbber_state.index(), 2); throbber_state.calc_step(-3); assert_eq!(throbber_state.index(), -1); throbber_state.calc_step(0); // random assert!((std::i8::MIN..=std::i8::MAX).contains(&throbber_state.index())) ``` -------------------------------- ### calc_next example Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.ThrobberState.html Example for the calc_next method. It creates a default ThrobberState, asserts the initial index is 0, calls calc_next, and asserts the index becomes 1. ```rust let mut throbber_state = throbber_widgets_tui::ThrobberState::default(); assert_eq!(throbber_state.index(), 0); throbber_state.calc_next(); assert_eq!(throbber_state.index(), 1); ``` -------------------------------- ### normalize example Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.ThrobberState.html Example for the normalize method. It shows how normalize wraps the index into the range of the throbber's symbol set length, handling both positive and negative indices. ```rust let mut throbber_state = throbber_widgets_tui::ThrobberState::default(); let throbber = throbber_widgets_tui::Throbber::default(); let len = 6; //throbber.throbber_set.symbols.len() as i8; throbber_state.normalize(&throbber); assert_eq!(throbber_state.index(), 0); throbber_state.calc_step(len + 2); assert_eq!(throbber_state.index(), len + 2); throbber_state.normalize(&throbber); assert_eq!(throbber_state.index(), 2); // Negative numbers are indexed from backward throbber_state.calc_step(-3 - len); assert_eq!(throbber_state.index(), -1 - len); throbber_state.normalize(&throbber); assert_eq!(throbber_state.index(), len - 1); ``` -------------------------------- ### Throbber usage example Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Shows how to create a Throbber with default settings, apply a throbber style, set a label, and create a ThrobberState for rendering. The render calls are commented out. ```rust let throbber = throbber_widgets_tui::Throbber::default() .throbber_style(ratatui::style::Style::default().fg(ratatui::style::Color::White).bg(ratatui::style::Color::Black)) .label("NOW LOADING..."); // frame.render_widget(throbber, chunks[0]); let throbber_state = throbber_widgets_tui::ThrobberState::default(); // frame.render_stateful_widget(throbber, chunks[0], &mut throbber_state); ``` -------------------------------- ### Throbber widget creation example Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/widgets/throbber.rs.html Shows how to create a Throbber widget with a custom style and label, and how to create a default ThrobberState. The render call is commented out. ```rust /// A compact widget to display a throbber. /// /// A throbber may also be called: /// - activity indicator /// - indeterminate progress bar /// - loading icon /// - spinner /// - guru guru /// /// # Examples: /// /// ``` /// let throbber = throbber_widgets_tui::Throbber::default() /// .throbber_style(ratatui::style::Style::default().fg(ratatui::style::Color::White).bg(ratatui::style::Color::Black)) /// .label("NOW LOADING..."); /// // frame.render_widget(throbber, chunks[0]); /// let throbber_state = throbber_widgets_tui::ThrobberState::default(); ``` -------------------------------- ### Example usage of Throbber widget Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/lib.rs.html Shows how to create a ThrobberState, update it on tick, and render both a simple random-step throbber and a fully configured throbber with label, style, and custom symbol set. ```rust // : // : struct App { throbber_state: throbber_widgets_tui::ThrobberState, } impl App { fn on_tick(&mut self) { self.throbber_state.calc_next(); } } // : // : fn ui(f: &mut ratatui::Frame, app: &mut App) { let chunks = ratatui::layout::Layout::default() .direction(ratatui::layout::Direction::Horizontal) .margin(1) .constraints( [ ratatui::layout::Constraint::Percentage(50), ratatui::layout::Constraint::Percentage(50), ] .as_ref(), ) .split(f.area()); // Simple random step let simple = throbber_widgets_tui::Throbber::default(); f.render_widget(simple, chunks[0]); // Set full with state let full = throbber_widgets_tui::Throbber::default() .label("Running...") .style(ratatui::style::Style::default().fg(ratatui::style::Color::Cyan)) .throbber_style(ratatui::style::Style::default().fg(ratatui::style::Color::Red).add_modifier(ratatui::style::Modifier::BOLD)) .throbber_set(throbber_widgets_tui::CLOCK) .use_type(throbber_widgets_tui::WhichUse::Spin); f.render_stateful_widget(full, chunks[1], &mut app.throbber_state); } ``` -------------------------------- ### ThrobberState::calc_step method with doc example Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/widgets/throbber.rs.html The calc_step method adjusts the index by a given step. If step is 0, the index is set to a random value when the 'rand' feature is enabled, or to a time-based value when 'std' is enabled, or remains unchanged in no_std without rand. The doc example shows positive, negative, and zero steps. ```rust /// Calculate the index by specifying step. /// /// Negative numbers can also be specified for step. /// /// If step is 0, the index is determined at random. /// /// # Examples: /// ``` /// let mut throbber_state = throbber_widgets_tui::ThrobberState::default(); /// assert_eq!(throbber_state.index(), 0); /// throbber_state.calc_step(2); /// assert_eq!(throbber_state.index(), 2); /// throbber_state.calc_step(-3); /// assert_eq!(throbber_state.index(), -1); /// throbber_state.calc_step(0); // random /// assert!((std::i8::MIN..=std::i8::MAX).contains(&throbber_state.index())) /// ``` pub fn calc_step(&mut self, step: i8) { self.index = if step == 0 { #[cfg(feature = "rand")] { let mut rng = rand::rng(); rng.random() } #[cfg(all(not(feature = "rand"), feature = "std"))] { let duration = std::time::SystemTime::now() .duration_since(std::time::UNIX_EPOCH) .unwrap_or_default(); // If the resolution is low, it might become zero, so I add multiple values. (duration.as_nanos() % 0x100 + duration.as_micros() % 0x100 + duration.as_millis() % 0x100) as i8 } #[cfg(all(not(feature = "rand"), not(feature = "std")))] { // In no_std without rand, keep current index unchanged. // Use calc_next() or calc_step(N) where N != 0 for animation. self.index } } else { self.index.checked_add(step).unwrap_or(0) } } ``` -------------------------------- ### ThrobberState::index and calc_next methods Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/widgets/throbber.rs.html The index method returns the current index. The calc_next method increments the index by 1, as shown in the doc example. ```rust impl ThrobberState { /// Get a index. pub fn index(&self) -> i8 { self.index } /// Increase index. /// /// # Examples: /// ``` /// let mut throbber_state = throbber_widgets_tui::ThrobberState::default(); /// assert_eq!(throbber_state.index(), 0); /// throbber_state.calc_next(); /// assert_eq!(throbber_state.index(), 1); /// ``` pub fn calc_next(&mut self) { self.calc_step(1); } ``` -------------------------------- ### ThrobberState::normalize method with doc example Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/widgets/throbber.rs.html The normalize method adjusts the index to be within the range of the throbber's symbol set length. It handles negative indices by counting from the end. The doc example demonstrates normalization after setting the index beyond the length and with negative values. ```rust /// Set the index to the range of throbber_set.symbols.len(). /// /// This is called from render function automatically. /// /// # Examples: /// ``` /// let mut throbber_state = throbber_widgets_tui::ThrobberState::default(); /// let throbber = throbber_widgets_tui::Throbber::default(); /// let len = 6; //throbber.throbber_set.symbols.len() as i8; /// /// throbber_state.normalize(&throbber); /// assert_eq!(throbber_state.index(), 0); /// /// throbber_state.calc_step(len + 2); /// assert_eq!(throbber_state.index(), len + 2); /// throbber_state.normalize(&throbber); /// assert_eq!(throbber_state.index(), 2); /// /// // Negative numbers are indexed from backward /// throbber_state.calc_step(-3 - len); /// assert_eq!(throbber_state.index(), -1 - len); /// throbber_state.normalize(&throbber); /// assert_eq!(throbber_state.index(), len - 1); /// ``` pub fn normalize(&mut self, throbber: &Throbber) { let len = throbber.throbber_set.symbols.len() as i8; if len <= 0 { //ng but it's not used, so it stays. } else { self.index %= len; if self.index < 0 { // Negative numbers are indexed from the tail self.index += len; } } } } ``` -------------------------------- ### ThrobberState Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.ThrobberState.html The ThrobberState struct provides methods to manage the index of a throbber animation. It includes methods to get the current index, increment it, calculate a new index based on a step, and normalize the index to fit within the throbber's symbol set. ```APIDOC ## [Struct] ThrobberState ### Description State to be used for Throbber render. ### Methods #### index() ##### Description Get a index. ##### Signature `pub fn index(&self) -> i8` ##### Parameters None ##### Returns - `i8` - The current index. #### calc_next() ##### Description Increase index. ##### Signature `pub fn calc_next(&mut self)` ##### Parameters None ##### Returns None ##### Example ```rust let mut throbber_state = throbber_widgets_tui::ThrobberState::default(); assert_eq!(throbber_state.index(), 0); throbber_state.calc_next(); assert_eq!(throbber_state.index(), 1); ``` #### calc_step(step: i8) ##### Description Calculate the index by specifying step. Negative numbers can also be specified for step. If step is 0, the index is determined at random. ##### Signature `pub fn calc_step(&mut self, step: i8)` ##### Parameters - **step** (i8) - Required - The step to add to the index. If 0, the index is set to a random value. ##### Returns None ##### Example ```rust let mut throbber_state = throbber_widgets_tui::ThrobberState::default(); assert_eq!(throbber_state.index(), 0); throbber_state.calc_step(2); assert_eq!(throbber_state.index(), 2); throbber_state.calc_step(-3); assert_eq!(throbber_state.index(), -1); throbber_state.calc_step(0); // random assert!((std::i8::MIN..=std::i8::MAX).contains(&throbber_state.index())) ``` #### normalize(throbber: &Throbber<'_>) ##### Description Set the index to the range of throbber_set.symbols.len(). This is called from render function automatically. ##### Signature `pub fn normalize(&mut self, throbber: &Throbber<'_>)` ##### Parameters - **throbber** (&Throbber<'_>) - Required - The throbber whose symbol set length is used for normalization. ##### Returns None ##### Example ```rust let mut throbber_state = throbber_widgets_tui::ThrobberState::default(); let throbber = throbber_widgets_tui::Throbber::default(); let len = 6; //throbber.throbber_set.symbols.len() as i8; throbber_state.normalize(&throbber); assert_eq!(throbber_state.index(), 0); throbber_state.calc_step(len + 2); assert_eq!(throbber_state.index(), len + 2); throbber_state.normalize(&throbber); assert_eq!(throbber_state.index(), 2); // Negative numbers are indexed from backward throbber_state.calc_step(-3 - len); assert_eq!(throbber_state.index(), -1 - len); throbber_state.normalize(&throbber); assert_eq!(throbber_state.index(), len - 1); ``` ``` -------------------------------- ### impl PartialEq for Throbber Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Provides equality comparison for Throbber instances. ```APIDOC ## PartialEq for Throbber ### Description Implements the PartialEq trait for Throbber, allowing equality comparison. ### Methods #### eq(&self, other: &Throbber<'a>) -> bool Equality operator `==`. #### ne(&self, other: &Rhs) -> bool Inequality operator `!=`. ``` -------------------------------- ### ThrobberState::calc_next Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/widgets/throbber.rs.html Increases the index by 1. ```APIDOC ## ThrobberState::calc_next ### Description Increases the index by 1. ### Method `pub fn calc_next(&mut self)` ### Parameters None. ### Returns None. ### Example ```rust let mut throbber_state = throbber_widgets_tui::ThrobberState::default(); assert_eq!(throbber_state.index(), 0); throbber_state.calc_next(); assert_eq!(throbber_state.index(), 1); ``` ``` -------------------------------- ### impl StatefulWidget for Throbber Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Renders the Throbber with a specified state, allowing control over the displayed symbol index. ```APIDOC ## StatefulWidget for Throbber ### Description Implements the StatefulWidget trait for Throbber, allowing rendering with a specified state. ### Associated Types - **State** = ThrobberState - State associated with the stateful widget. ### Methods #### render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) Render specified index symbols. ``` -------------------------------- ### impl Clone for Throbber Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Provides cloning functionality for Throbber instances. ```APIDOC ## Clone for Throbber ### Description Implements the Clone trait for Throbber, allowing duplication of the value. ### Methods #### clone(&self) -> Throbber<'a> Returns a duplicate of the value. #### clone_from(&mut self, source: &Self) Performs copy-assignment from `source`. ``` -------------------------------- ### impl Debug for Throbber Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Provides debug formatting for Throbber instances. ```APIDOC ## Debug for Throbber ### Description Implements the Debug trait for Throbber, allowing formatting with the given formatter. ### Methods #### fmt(&self, f: &mut Formatter<'_>) -> Result Formats the value using the given formatter. ``` -------------------------------- ### impl Widget for Throbber Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Renders the Throbber with random step symbols. ```APIDOC ## Widget for Throbber ### Description Implements the Widget trait for Throbber, allowing rendering with random step symbols. ### Methods #### render(self, area: Rect, buf: &mut Buffer) Render random step symbols. ``` -------------------------------- ### impl Default for Throbber Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Provides a default value for Throbber. ```APIDOC ## Default for Throbber ### Description Implements the Default trait for Throbber, returning the default value. ### Methods #### default() -> Self Returns the “default value” for a type. ``` -------------------------------- ### ThrobberState::calc_step Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/widgets/throbber.rs.html Calculates the index by adding a step. If step is 0, the index is set to a random value (if the 'rand' feature is enabled) or remains unchanged (if no 'rand' feature). ```APIDOC ## ThrobberState::calc_step ### Description Calculates the index by adding a step. If step is 0, the index is set to a random value (if the 'rand' feature is enabled) or remains unchanged (if no 'rand' feature). ### Method `pub fn calc_step(&mut self, step: i8)` ### Parameters - `step` (i8) - The step to add to the current index. Negative numbers are allowed. If 0, the index is randomized (if 'rand' feature is enabled) or unchanged. ### Returns None. ### Example ```rust let mut throbber_state = throbber_widgets_tui::ThrobberState::default(); assert_eq!(throbber_state.index(), 0); throbber_state.calc_step(2); assert_eq!(throbber_state.index(), 2); throbber_state.calc_step(-3); assert_eq!(throbber_state.index(), -1); throbber_state.calc_step(0); // random assert!((std::i8::MIN..=std::i8::MAX).contains(&throbber_state.index())) ``` ``` -------------------------------- ### throbber::OGHAM_C Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using Ogham characters: `[" ", "ᚆ", "ᚇ", "ᚈ", "ᚉ", "ᚊ"]` with full symbol `ᚊ` and empty symbol full-width space. ```APIDOC ## Constant `throbber::OGHAM_C` ### Description A predefined `Set` with Ogham symbols. ### Value - **full**: `"ᚊ"` - **empty**: `" "` - **symbols**: `[" ", "ᚆ", "ᚇ", "ᚈ", "ᚉ", "ᚊ"]` ``` -------------------------------- ### Declare throbber module and re-export Throbber and ThrobberState Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/widgets/mod.rs.html Declares the `throbber` submodule and re-exports `Throbber` and `ThrobberState` for public use. ```rust mod throbber; pub use self::throbber::Throbber; pub use self::throbber::ThrobberState; ``` -------------------------------- ### throbber::OGHAM_A Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using Ogham characters: `[" ", "ᚐ", "ᚑ", "ᚒ", "ᚓ", "ᚔ"]` with full symbol `ᚔ` and empty symbol full-width space. ```APIDOC ## Constant `throbber::OGHAM_A` ### Description A predefined `Set` with Ogham symbols. ### Value - **full**: `"ᚔ"` - **empty**: `" "` - **symbols**: `[" ", "ᚐ", "ᚑ", "ᚒ", "ᚓ", "ᚔ"]` ``` -------------------------------- ### impl From for Line Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Converts a Throbber into a Line, using a random state index. ```APIDOC ## From for Line ### Description Converts a Throbber into a Line, using a random state index. To specify a state, use `Throbber::to_line()`. ### Methods #### from(throbber: Throbber<'a>) -> Line<'a> Converts to this type from the input type. ``` -------------------------------- ### pub const OGHAM_B: Set; Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/symbols/throbber/constant.OGHAM_B.html A public constant representing a set of Ogham characters used as a throbber animation sequence. ```APIDOC ## Constant OGHAM_B ### Description A public constant of type `Set` that holds a sequence of Ogham characters for use as a throbber animation. ### Declaration ```rust pub const OGHAM_B: Set; ``` ### Value The constant contains the following string sequence: `[" ", "ᚁ", "ᚂ", "ᚃ", "ᚄ", "ᚅ"]`. ### Usage This constant can be used directly in throbber widgets to display an Ogham-based animation. ``` -------------------------------- ### throbber::OGHAM_B Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using Ogham characters: `[" ", "ᚁ", "ᚂ", "ᚃ", "ᚄ", "ᚅ"]` with full symbol `ᚅ` and empty symbol full-width space. ```APIDOC ## Constant `throbber::OGHAM_B` ### Description A predefined `Set` with Ogham symbols. ### Value - **full**: `"ᚅ"` - **empty**: `" "` - **symbols**: `[" ", "ᚁ", "ᚂ", "ᚃ", "ᚄ", "ᚅ"]` ``` -------------------------------- ### PARENTHESIS Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/symbols/throbber/constant.PARENTHESIS.html A constant Set of six Unicode characters representing a throbber animation sequence. ```APIDOC ## PARENTHESIS ### Description A constant `Set` of Unicode characters used as a throbber animation sequence. ### Declaration ```rust pub const PARENTHESIS: Set; ``` ### Value ["⎛", "⎜", "⎝", "⎞", "⎟", "⎠"] ``` -------------------------------- ### throbber::BOX_DRAWING Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using box drawing characters: `["│", "╱", "─", "╲"]` with full symbol `┼` and empty symbol full-width space. ```APIDOC ## Constant `throbber::BOX_DRAWING` ### Description A predefined `Set` with box drawing symbols. ### Value - **full**: `"┼"` - **empty**: `" "` - **symbols**: `["│", "╱", "─", "╲"]` ``` -------------------------------- ### ThrobberState::index Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/widgets/throbber.rs.html Returns the current index of the ThrobberState. ```APIDOC ## ThrobberState::index ### Description Returns the current index of the ThrobberState. ### Method `pub fn index(&self) -> i8` ### Parameters None. ### Returns - `i8` - The current index value. ``` -------------------------------- ### Add throbber-widgets-tui dependency Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/lib.rs.html Adds the throbber-widgets-tui crate to your project using cargo add. Requires rustc 1.88.0 or newer. ```sh cargo add throbber-widgets-tui ``` -------------------------------- ### pub const WHITE_SQUARE: Set Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/symbols/throbber/constant.WHITE_SQUARE.html A constant representing a set of four Unicode characters used as a throbber animation sequence. ```APIDOC ## Constant WHITE_SQUARE ### Description A constant of type `Set` that contains the characters `['◳', '◲', '◱', '◰']`. It is used as a throbber animation sequence. ### Signature ```rust pub const WHITE_SQUARE: Set; ``` ### Value The value is a `Set` containing the following characters in order: - `'◳'` - `'◲'` - `'◱'` - `'◰'` ### Usage This constant can be used in throbber widgets to display an animated sequence of white square characters. ``` -------------------------------- ### throbber::ASCII Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using ASCII characters: `["|", "/", "-", "\\"]` with full symbol `*` and empty symbol space. ```APIDOC ## Constant `throbber::ASCII` ### Description A predefined `Set` with ASCII symbols. ### Value - **full**: `"*"` - **empty**: `" "` - **symbols**: `["|", "/", "-", "\\"]` ``` -------------------------------- ### throbber::BRAILLE_ONE Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using braille characters: `["⠈", "⠐", "⠠", "⠄", "⠂", "⠁"]` with full symbol `⠿` and empty symbol full-width space. ```APIDOC ## Constant `throbber::BRAILLE_ONE` ### Description A predefined `Set` with braille symbols. ### Value - **full**: `"⠿"` - **empty**: `" "` - **symbols**: `["⠈", "⠐", "⠠", "⠄", "⠂", "⠁"]` ``` -------------------------------- ### throbber::QUADRANT_BLOCK_CRACK Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using quadrant block crack characters: `["▙", "▛", "▜", "▟"]` with full symbol `█` and empty symbol full-width space. ```APIDOC ## Constant `throbber::QUADRANT_BLOCK_CRACK` ### Description A predefined `Set` with quadrant block crack symbols. ### Value - **full**: `"█"` - **empty**: `" "` - **symbols**: `["▙", "▛", "▜", "▟"]` ``` -------------------------------- ### Throbber::to_line Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Converts the throbber symbol and label to a Line with the given state. This is useful for rendering the throbber with its label. ```APIDOC ## Throbber::to_line ### Description Converts the throbber symbol and label to a Line with the given state. This is useful for rendering the throbber with its label. ### Method `pub fn to_line(&self, state: &ThrobberState) -> Line<'a>` ### Parameters - **state** (`&ThrobberState`) - Required - The current state of the throbber. ### Returns `Line<'a>` - A Line containing the throbber symbol and label. ``` -------------------------------- ### throbber::BRAILLE_SIX Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using braille characters: `["⠷", "⠯", "⠟", "⠻", "⠽", "⠾"]` with full symbol `⠿` and empty symbol full-width space. ```APIDOC ## Constant `throbber::BRAILLE_SIX` ### Description A predefined `Set` with braille symbols. ### Value - **full**: `"⠿"` - **empty**: `" "` - **symbols**: `["⠷", "⠯", "⠟", "⠻", "⠽", "⠾"]` ``` -------------------------------- ### throbber::ARROW Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using arrow characters: `["↑", "↗", "→", "↘", "↓", "↙", "←", "↖"]` with full symbol `↔` and empty symbol full-width space. ```APIDOC ## Constant `throbber::ARROW` ### Description A predefined `Set` with arrow symbols. ### Value - **full**: `"↔"` - **empty**: `" "` - **symbols**: `["↑", "↗", "→", "↘", "↓", "↙", "←", "↖"]` ``` -------------------------------- ### Throbber::use_type Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Sets the usage type of the throbber, which determines how the throbber is used (e.g., as a widget or stateful widget). ```APIDOC ## Throbber::use_type ### Description Sets the usage type of the throbber, which determines how the throbber is used (e.g., as a widget or stateful widget). ### Method `pub fn use_type(self, use_type: WhichUse) -> Self` ### Parameters - **use_type** (`WhichUse`) - Required - The usage type. ### Returns `Self` - The updated `Throbber` instance. ``` -------------------------------- ### throbber::PARENTHESIS Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using parenthesis characters: `["⎛", "⎜", "⎝", "⎞", "⎟", "⎠"]` with full symbol `∫` and empty symbol full-width space. ```APIDOC ## Constant `throbber::PARENTHESIS` ### Description A predefined `Set` with parenthesis symbols. ### Value - **full**: `"∫"` - **empty**: `" "` - **symbols**: `["⎛", "⎜", "⎝", "⎞", "⎟", "⎠"]` ``` -------------------------------- ### pub const CLOCK: Set; Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/symbols/throbber/constant.CLOCK.html A public constant that provides a set of clock face symbols for use in throbber animations. It contains a sequence of Unicode clock face emoji characters from 🕛 to 🕦. ```APIDOC ## pub const CLOCK: Set; ### Description A public constant that provides a set of clock face symbols for use in throbber animations. It contains a sequence of Unicode clock face emoji characters from 🕛 to 🕦. ### Declaration ```rust pub const CLOCK: Set; ``` ### Value The constant is a `Set` containing the following symbols: - 🕛 - 🕧 - 🕐 - 🕜 - 🕑 - ... - 🕚 - 🕦 ### Usage This constant can be used as a throbber animation set in the `throbber_widgets_tui` crate. It is part of the `throbber_widgets_tui::symbols::throbber` module. ### Example ```rust use throbber_widgets_tui::symbols::throbber::CLOCK; // Use CLOCK in a throbber widget ``` ``` -------------------------------- ### impl From for Span Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Converts a Throbber into a Span, using a random state index. ```APIDOC ## From for Span ### Description Converts a Throbber into a Span, using a random state index. To specify a state, use `Throbber::to_symbol_span()`. ### Methods #### from(throbber: Throbber<'a>) -> Span<'a> Converts to this type from the input type. ``` -------------------------------- ### throbber::CLOCK Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using clock face characters: `["🕛", "🕧", "🕐", "🕜", "🕑", ..., "🕚", "🕦"]` with full symbol `🕛` and empty symbol full-width space. ```APIDOC ## Constant `throbber::CLOCK` ### Description A predefined `Set` with clock face symbols. ### Value - **full**: `"🕛"` - **empty**: `" "` - **symbols**: `["🕛", "🕧", "🕐", "🕜", "🕑", "🕝", "🕒", "🕞", "🕓", "🕟", "🕔", "🕠", "🕕", "🕡", "🕖", "🕢", "🕗", "🕣", "🕘", "🕤", "🕙", "🕥", "🕚", "🕦"]` ``` -------------------------------- ### throbber::DOUBLE_ARROW Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using double arrow characters: `["⇑", "⇗", "⇒", "⇘", "⇓", "⇙", "⇐", "⇖"]` with full symbol `⇔` and empty symbol full-width space. ```APIDOC ## Constant `throbber::DOUBLE_ARROW` ### Description A predefined `Set` with double arrow symbols. ### Value - **full**: `"⇔"` - **empty**: `" "` - **symbols**: `["⇑", "⇗", "⇒", "⇘", "⇓", "⇙", "⇐", "⇖"]` ``` -------------------------------- ### throbber::BRAILLE_EIGHT Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using braille characters: `["⣷", "⣯", "⣟", "⡿", "⢿", "⣻", "⣽", "⣾"]` with full symbol `⣿` and empty symbol full-width space. ```APIDOC ## Constant `throbber::BRAILLE_EIGHT` ### Description A predefined `Set` with braille symbols. ### Value - **full**: `"⣿"` - **empty**: `" "` - **symbols**: `["⣷", "⣯", "⣟", "⡿", "⢿", "⣻", "⣽", "⣾"]` ``` -------------------------------- ### throbber::BRAILLE_SIX_DOUBLE Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using braille characters: `["⠧", "⠏", "⠛", "⠹", "⠼", "⠶"]` with full symbol `⠿` and empty symbol full-width space. ```APIDOC ## Constant `throbber::BRAILLE_SIX_DOUBLE` ### Description A predefined `Set` with braille symbols. ### Value - **full**: `"⠿"` - **empty**: `" "` - **symbols**: `["⠧", "⠏", "⠛", "⠹", "⠼", "⠶"]` ``` -------------------------------- ### pub const WHITE_CIRCLE: Set Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/symbols/throbber/constant.WHITE_CIRCLE.html A public constant representing a set of throbber animation symbols. It is defined as an array of four Unicode characters: ["◷", "◶", "◵", "◴"]. ```APIDOC ## Constant WHITE_CIRCLE ### Description A public constant of type `Set` that holds an array of four Unicode characters used as throbber animation frames. ### Declaration ```rust pub const WHITE_CIRCLE: Set; ``` ### Value The constant is initialized with the following array of characters: ```rust ["◷", "◶", "◵", "◴"] ``` ### Usage This constant can be used to provide a set of throbber symbols for animation in a TUI application. ``` -------------------------------- ### throbber::WHITE_CIRCLE Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using white circle characters: `["◷", "◶", "◵", "◴"]` with full symbol `⊕` and empty symbol full-width space. ```APIDOC ## Constant `throbber::WHITE_CIRCLE` ### Description A predefined `Set` with white circle symbols. ### Value - **full**: `"⊕"` - **empty**: `" "` - **symbols**: `["◷", "◶", "◵", "◴"]` ``` -------------------------------- ### Throbber::label Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Sets the label of the throbber. The label is displayed alongside the throbber symbol. ```APIDOC ## Throbber::label ### Description Sets the label of the throbber. The label is displayed alongside the throbber symbol. ### Method `pub fn label(self, label: T) -> Self` ### Parameters - **label** (`T`) - Required - The label to display. Must implement `Into>`. ### Returns `Self` - The updated `Throbber` instance. ### Example ```rust let throbber = Throbber::default().label("NOW LOADING..."); ``` ``` -------------------------------- ### Throbber::style Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/widgets/struct.Throbber.html Sets the style of the throbber widget. This style applies to the entire widget. ```APIDOC ## Throbber::style ### Description Sets the style of the throbber widget. This style applies to the entire widget. ### Method `pub fn style(self, style: Style) -> Self` ### Parameters - **style** (`Style`) - Required - The style to apply. ### Returns `Self` - The updated `Throbber` instance. ``` -------------------------------- ### throbber::BRAILLE_DOUBLE Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using braille characters: `["⠘", "⠰", "⠤", "⠆", "⠃", "⠉"]` with full symbol `⠿` and empty symbol full-width space. ```APIDOC ## Constant `throbber::BRAILLE_DOUBLE` ### Description A predefined `Set` with braille symbols. ### Value - **full**: `"⠿"` - **empty**: `" "` - **symbols**: `["⠘", "⠰", "⠤", "⠆", "⠃", "⠉"]` ``` -------------------------------- ### throbber::Set Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A struct representing a set of symbols to be rendered by a throbber. It contains fields for the full symbol, empty symbol, and an array of animation symbols. ```APIDOC ## Struct `throbber::Set` ### Description A set of symbols to be rendered by a throbber. Contains the full symbol, empty symbol, and a list of animation symbols. ### Fields - **full** (`&'static str`) - The symbol used for the full state. - **empty** (`&'static str`) - The symbol used for the empty state. - **symbols** (`&'static [&'static str]`) - The list of symbols used for the spinning animation. ### Derives `Debug`, `Clone`, `PartialEq`, `Eq` ``` -------------------------------- ### throbber::VERTICAL_BLOCK Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using vertical block characters: `["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"]` with full symbol `█` and empty symbol full-width space. ```APIDOC ## Constant `throbber::VERTICAL_BLOCK` ### Description A predefined `Set` with vertical block symbols. ### Value - **full**: `"█"` - **empty**: `" "` - **symbols**: `["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"]` ``` -------------------------------- ### throbber::BRAILLE_EIGHT_DOUBLE Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using braille characters: `["⣧", "⣏", "⡟", "⠿", "⢻", "⣹", "⣼", "⣶"]` with full symbol `⣿` and empty symbol full-width space. ```APIDOC ## Constant `throbber::BRAILLE_EIGHT_DOUBLE` ### Description A predefined `Set` with braille symbols. ### Value - **full**: `"⣿"` - **empty**: `" "` - **symbols**: `["⣧", "⣏", "⡟", "⠿", "⢻", "⣹", "⣼", "⣶"]` ``` -------------------------------- ### throbber::HORIZONTAL_BLOCK Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using horizontal block characters: `["▏", "▎", "▍", "▌", "▋", "▊", "▉", "█"]` with full symbol `█` and empty symbol full-width space. ```APIDOC ## Constant `throbber::HORIZONTAL_BLOCK` ### Description A predefined `Set` with horizontal block symbols. ### Value - **full**: `"█"` - **empty**: `" "` - **symbols**: `["▏", "▎", "▍", "▌", "▋", "▊", "▉", "█"]` ``` -------------------------------- ### Enum WhichUse Source: https://docs.rs/throbber-widgets-tui/latest/throbber_widgets_tui/symbols/throbber/enum.WhichUse.html The WhichUse enum is a public API type that users can directly use to specify which throbber symbol set to render. It has three variants: Full, Empty, and Spin. ```APIDOC ## Enum WhichUse ### Description The `WhichUse` enum represents the rendering object for throbber symbols. It is used to select which symbol set to use when rendering a throbber. If `Spin` is specified, the `ThrobberState.index` is used. ### Variants - **Full** - Represents the full symbol set. - **Empty** - Represents the empty symbol set. - **Spin** - Represents the spinning symbol set, using `ThrobberState.index`. ### Usage This enum is part of the public API of the `throbber_widgets_tui` crate and can be used directly by users to configure throbber rendering. ``` -------------------------------- ### throbber::WHITE_SQUARE Source: https://docs.rs/throbber-widgets-tui/latest/src/throbber_widgets_tui/symbols.rs.html A predefined symbol set using white square characters: `["◳", "◲", "◱", "◰"]` with full symbol `⊞` and empty symbol full-width space. ```APIDOC ## Constant `throbber::WHITE_SQUARE` ### Description A predefined `Set` with white square symbols. ### Value - **full**: `"⊞"` - **empty**: `" "` - **symbols**: `["◳", "◲", "◱", "◰"]` ```