[][src]Struct prodash::tui::TuiOptions

pub struct TuiOptions {
    pub title: String,
    pub frames_per_second: f32,
    pub recompute_column_width_every_nth_frame: Option<usize>,
    pub window_size: Option<Rect>,
    pub redraw_only_on_state_change: bool,
}

Configure the terminal user interface

Fields

title: String

The initial title to show for the whole window.

Can be adjusted later by sending Event::SetTitle(…) into the event stream, see see tui::render_with_input(…events) function.

frames_per_second: f32

The amount of frames to draw per second. If below 1.0, it determines the amount of seconds between the frame.

e.g. 1.0/4.0 is one frame every 4 seconds.

recompute_column_width_every_nth_frame: Option<usize>

If set, recompute the column width of the task tree only every given frame. Otherwise the width will be recomputed every frame.

Use this if there are many short-running tasks with varying names paired with high refresh rates of multiple frames per second to stabilize the appearance of the TUI.

For example, setting the value to 40 will with a frame rate of 20 per second will recompute the column width to fit all task names every 2 seconds.

window_size: Option<Rect>

The initial window size.

If unset, it will be retrieved from the current terminal.

redraw_only_on_state_change: bool

If true (default: false), we will skip potentially expensive redraws if nothing would change. This doubles the amount of memory.

This is particularly useful if most of the time, the actual change rate is lower than the refresh rate. Drawing is expensive.

Trait Implementations

impl Clone for TuiOptions[src]

impl Default for TuiOptions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.