Skip to main content

StatusBar

Struct StatusBar 

Source
pub struct StatusBar { /* private fields */ }
Expand description

A three-section status bar (left, center, right).

Implementations§

Source§

impl StatusBar

Source

pub fn new(bounds: Rect) -> Self

Create a new status bar with the given bounds.

Source

pub const fn with_config(bounds: Rect, config: StatusBarConfig) -> Self

Create a new status bar with custom configuration.

Source

pub fn set_left(&mut self, text: impl Into<String>)

Set the left section content.

Source

pub fn set_center(&mut self, text: impl Into<String>)

Set the center section content.

Source

pub fn set_right(&mut self, text: impl Into<String>)

Set the right section content.

Source

pub fn set_all( &mut self, left: impl Into<String>, center: impl Into<String>, right: impl Into<String>, )

Set all sections at once.

Source

pub fn left(&self) -> &str

Get the left section content.

Source

pub fn center(&self) -> &str

Get the center section content.

Source

pub fn right(&self) -> &str

Get the right section content.

Trait Implementations§

Source§

impl Debug for StatusBar

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Widget for StatusBar

Source§

fn bounds(&self) -> Rect

Get the current bounds of this widget.
Source§

fn set_bounds(&mut self, bounds: Rect)

Set the bounds of this widget. Read more
Source§

fn render(&self, buffer: &mut Buffer)

Render this widget to the given buffer. Read more
Source§

fn handle_input(&mut self, _event: &InputEvent) -> bool

Handle an input event. Read more
Source§

fn needs_redraw(&self) -> bool

Check if this widget needs to be redrawn.
Source§

fn clear_redraw(&mut self)

Clear the redraw flag after rendering.

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, 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.