pub struct LoadingIndicator;Expand description
A standalone loading spinner widget.
Renders a braille spinner animation centered in its area.
When ctx.skip_animations is true, renders static “Loading…” text instead,
which is safe for snapshot tests.
§Default CSS
LoadingIndicator { width: 100%; height: 100%; min-height: 1; }§Example
let layout = Vertical::with_children(vec![
Box::new(LoadingIndicator::new()),
]);Implementations§
Trait Implementations§
Source§impl Default for LoadingIndicator
impl Default for LoadingIndicator
Source§impl Widget for LoadingIndicator
impl Widget for LoadingIndicator
Source§fn widget_type_name(&self) -> &'static str
fn widget_type_name(&self) -> &'static str
Source§fn default_css() -> &'static strwhere
Self: Sized,
fn default_css() -> &'static strwhere
Self: Sized,
Built-in default CSS for this widget type (static version). Read more
Source§fn render(&self, ctx: &AppContext, area: Rect, buf: &mut Buffer)
fn render(&self, ctx: &AppContext, area: Rect, buf: &mut Buffer)
Paint this widget’s content into the terminal buffer. Read more
Source§fn compose(&self) -> Vec<Box<dyn Widget>>
fn compose(&self) -> Vec<Box<dyn Widget>>
Declare child widgets. Called once at mount time to build the widget tree. Read more
Source§fn on_mount(&self, _id: WidgetId)
fn on_mount(&self, _id: WidgetId)
Called when this widget is inserted into the widget tree. Read more
Source§fn on_unmount(&self, _id: WidgetId)
fn on_unmount(&self, _id: WidgetId)
Called when this widget is removed from the widget tree. Read more
Source§fn can_focus(&self) -> bool
fn can_focus(&self) -> bool
Whether this widget participates in Tab-based focus cycling. Read more
Source§fn is_modal(&self) -> bool
fn is_modal(&self) -> bool
Whether this screen blocks all keyboard and mouse input to screens beneath it. Read more
Source§fn classes(&self) -> &[&str]
fn classes(&self) -> &[&str]
CSS class names applied to this widget instance (e.g.,
&["primary", "active"]). Read moreSource§fn id(&self) -> Option<&str>
fn id(&self) -> Option<&str>
Element ID for this widget instance (used for
#id CSS selectors). Read moreSource§fn widget_default_css(&self) -> &'static str
fn widget_default_css(&self) -> &'static str
Instance-callable version of
default_css(). Override this alongside
default_css() to return the same value — this version is callable on
dyn Widget and used by the framework to collect default styles at mount time.Source§fn on_event(&self, _event: &dyn Any, _ctx: &AppContext) -> EventPropagation
fn on_event(&self, _event: &dyn Any, _ctx: &AppContext) -> EventPropagation
Handle a dispatched event/message. Downcast to concrete types to handle. Read more
Source§fn key_bindings(&self) -> &[KeyBinding]
fn key_bindings(&self) -> &[KeyBinding]
Declare key bindings for this widget. Read more
Source§fn on_action(&self, _action: &str, _ctx: &AppContext)
fn on_action(&self, _action: &str, _ctx: &AppContext)
Handle a key binding action. Called when a key matching a binding is pressed. Read more
Source§fn border_color_override(&self) -> Option<(u8, u8, u8)>
fn border_color_override(&self) -> Option<(u8, u8, u8)>
Override the border color for this widget based on internal state. Read more
Source§fn is_overlay(&self) -> bool
fn is_overlay(&self) -> bool
Whether this widget is a transparent overlay (context menu, tooltip, etc.).
Overlay widgets skip paint_chrome (no background fill, no border from CSS)
and paint their own chrome in render(). This prevents overlays from
erasing the underlying screen content.
Return context menu items for right-click. Empty vec = no context menu.
Override to provide widget-specific menu items.
Source§fn click_action(&self) -> Option<&str>
fn click_action(&self) -> Option<&str>
Return the action to trigger on mouse click, if any. Read more
Source§fn has_text_selection(&self) -> bool
fn has_text_selection(&self) -> bool
Whether this widget currently has selected text. Read more
Auto Trait Implementations§
impl Freeze for LoadingIndicator
impl RefUnwindSafe for LoadingIndicator
impl Send for LoadingIndicator
impl Sync for LoadingIndicator
impl Unpin for LoadingIndicator
impl UnsafeUnpin for LoadingIndicator
impl UnwindSafe for LoadingIndicator
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> 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 moreSource§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.