Skip to main content

Bar

Struct Bar 

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

A horizontal bar spanning [begin, end] within [0, size]. Mirrors rich.bar.Bar.

Implementations§

Source§

impl Bar

Source

pub fn new(size: f64, begin: f64, end: f64) -> Self

A bar covering [begin, end] of a [0, size] range.

Source

pub fn width(self, width: usize) -> Self

Fix the bar width (otherwise it fills the available width).

Trait Implementations§

Source§

impl Renderable for Bar

Source§

fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement

Port of Bar.__rich_measure__: its fixed width, else at least four cells and up to the whole width.

Source§

fn rich_render( &self, _console: &Console, options: &ConsoleOptions, ) -> Vec<Segment>

Source§

fn fit_to_measurement(&self) -> bool

Whether a top-level Console::print shrinks this renderable to its measured width. Upstream renders every top-level renderable at the full console width, so the default is false; an extension may opt in.

Auto Trait Implementations§

§

impl Freeze for Bar

§

impl RefUnwindSafe for Bar

§

impl Send for Bar

§

impl Sync for Bar

§

impl Unpin for Bar

§

impl UnsafeUnpin for Bar

§

impl UnwindSafe for Bar

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.