LineGauge

Struct LineGauge 

Source
pub struct LineGauge<'a> { /* private fields */ }
Expand description

A compact widget to display a task progress over a single line.

§Examples:

LineGauge::default()
    .block(Block::default().borders(Borders::ALL).title("Progress"))
    .gauge_style(Style::default().fg(Color::White).bg(Color::Black).add_modifier(Modifier::BOLD))
    .line_set(symbols::line::THICK)
    .ratio(0.4);

Implementations§

Source§

impl<'a> LineGauge<'a>

Source

pub fn block(self, block: Block<'a>) -> Self

Source

pub fn ratio(self, ratio: f64) -> Self

Source

pub fn line_set(self, set: Set) -> Self

Source

pub fn label<T>(self, label: T) -> Self
where T: Into<Spans<'a>>,

Source

pub fn style(self, style: Style) -> Self

Source

pub fn gauge_style(self, style: Style) -> Self

Trait Implementations§

Source§

impl<'a> Default for LineGauge<'a>

Source§

fn default() -> Self

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

impl<'a> Widget for LineGauge<'a>

Source§

fn render(self, area: Rect, buf: &mut Buffer)

Draws the current state of the widget in the given buffer. That is the only method required to implement a custom widget.

Auto Trait Implementations§

§

impl<'a> Freeze for LineGauge<'a>

§

impl<'a> RefUnwindSafe for LineGauge<'a>

§

impl<'a> Send for LineGauge<'a>

§

impl<'a> Sync for LineGauge<'a>

§

impl<'a> Unpin for LineGauge<'a>

§

impl<'a> UnwindSafe for LineGauge<'a>

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.