pub struct Throbber<'a> { /* private fields */ }
Expand description
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();
// frame.render_stateful_widget(throbber, chunks[0], &mut throbber_state);
Implementations§
Source§impl<'a> Throbber<'a>
impl<'a> Throbber<'a>
pub fn label<T>(self, label: T) -> Self
pub fn style(self, style: Style) -> Self
pub fn throbber_style(self, style: Style) -> Self
pub fn throbber_set(self, set: Set) -> Self
pub fn use_type(self, use_type: WhichUse) -> Self
Sourcepub fn to_symbol_span(&self, state: &ThrobberState) -> Span<'a>
pub fn to_symbol_span(&self, state: &ThrobberState) -> Span<'a>
Convert symbol only to Span with state.
Sourcepub fn to_line(&self, state: &ThrobberState) -> Line<'a>
pub fn to_line(&self, state: &ThrobberState) -> Line<'a>
Convert symbol and label to Line with state.
Trait Implementations§
Source§impl<'a> From<Throbber<'a>> for Line<'a>
Convert symbol and label to Line without state(mostly random index).
impl<'a> From<Throbber<'a>> for Line<'a>
Convert symbol and label to Line without state(mostly random index).
If you want to specify a state, use Throbber::to_line()
.
Source§impl<'a> From<Throbber<'a>> for Span<'a>
Convert symbol only to Span without state(mostly random index).
impl<'a> From<Throbber<'a>> for Span<'a>
Convert symbol only to Span without state(mostly random index).
If you want to specify a state, use Throbber::to_symbol_span()
.
Source§impl<'a> StatefulWidget for Throbber<'a>
impl<'a> StatefulWidget for Throbber<'a>
Auto Trait Implementations§
impl<'a> Freeze for Throbber<'a>
impl<'a> RefUnwindSafe for Throbber<'a>
impl<'a> Send for Throbber<'a>
impl<'a> Sync for Throbber<'a>
impl<'a> Unpin for Throbber<'a>
impl<'a> UnwindSafe for Throbber<'a>
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