Skip to main content

Display

Trait Display 

Source
pub trait Display {
    // Required methods
    fn refresh(&self);
    fn blank(&self);
    fn get_title(&self) -> &str;
    fn set_title(&mut self, from: &str);
    fn update_dimensions(&mut self, to: usize);

    // Provided methods
    fn println(&self, string: &str) { ... }
    fn eprintln(&self, string: &str) { ... }
}
Expand description

A trait for all bars’ displaying

Required Methods§

Source

fn refresh(&self)

Refresh the display

Source

fn blank(&self)

Blank the display

Source

fn get_title(&self) -> &str

Get the title for this display

Source

fn set_title(&mut self, from: &str)

Set the title for this display

Source

fn update_dimensions(&mut self, to: usize)

Update the max size if needed

Provided Methods§

Source

fn println(&self, string: &str)

Blank then print a line, and redisplay.

Source

fn eprintln(&self, string: &str)

Blank then print a line std stderr, and redisplay.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Display for !

Source§

fn refresh(&self)

Source§

fn blank(&self)

Source§

fn println(&self, _: &str)

Source§

fn eprintln(&self, _: &str)

Source§

fn get_title(&self) -> &str

Source§

fn set_title(&mut self, _: &str)

Source§

fn update_dimensions(&mut self, _: usize)

Source§

impl Display for Infallible

Source§

fn refresh(&self)

Source§

fn blank(&self)

Source§

fn println(&self, _: &str)

Source§

fn eprintln(&self, _: &str)

Source§

fn get_title(&self) -> &str

Source§

fn set_title(&mut self, _: &str)

Source§

fn update_dimensions(&mut self, _: usize)

Source§

impl<T> Display for Box<T>
where T: Display + ?Sized,

Source§

fn refresh(&self)

Source§

fn blank(&self)

Source§

fn println(&self, string: &str)

Source§

fn eprintln(&self, string: &str)

Source§

fn get_title(&self) -> &str

Source§

fn set_title(&mut self, from: &str)

Source§

fn update_dimensions(&mut self, to: usize)

Implementors§

Source§

impl Display for Silent

Source§

impl<T: ?Sized + Write + AsFd> Display for Bar<T>

Source§

impl<T: ?Sized + Write> Display for Spin<T>

Source§

impl<T> Display for MaybeSilent<T>
where T: Display,