Skip to main content

LoadingIndicator

Struct LoadingIndicator 

Source
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§

Source§

impl LoadingIndicator

Source

pub fn new() -> Self

Create a new LoadingIndicator.

Trait Implementations§

Source§

impl Default for LoadingIndicator

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Widget for LoadingIndicator

Source§

fn widget_type_name(&self) -> &'static str

The CSS type selector name for this widget (e.g., "Button", "Input"). Read more
Source§

fn default_css() -> &'static str
where 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)

Paint this widget’s content into the terminal buffer. Read more
Source§

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)

Called when this widget is inserted into the widget tree. Read more
Source§

fn on_unmount(&self, _id: WidgetId)

Called when this widget is removed from the widget tree. Read more
Source§

fn can_focus(&self) -> bool

Whether this widget participates in Tab-based focus cycling. Read more
Source§

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]

CSS class names applied to this widget instance (e.g., &["primary", "active"]). Read more
Source§

fn id(&self) -> Option<&str>

Element ID for this widget instance (used for #id CSS selectors). Read more
Source§

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

Handle a dispatched event/message. Downcast to concrete types to handle. Read more
Source§

fn key_bindings(&self) -> &[KeyBinding]

Declare key bindings for this widget. Read more
Source§

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)>

Override the border color for this widget based on internal state. Read more
Source§

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.
Source§

fn context_menu_items(&self) -> Vec<ContextMenuItem>

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>

Return the action to trigger on mouse click, if any. Read more
Source§

fn has_text_selection(&self) -> bool

Whether this widget currently has selected text. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.