pub struct Options {
pub title: String,
pub frames_per_second: f32,
pub throughput: bool,
pub recompute_column_width_every_nth_frame: Option<usize>,
pub window_size: Option<Rect>,
pub stop_if_progress_missing: bool,
}
Expand description
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.
throughput: bool
If true, (default false), we will keep track of the previous progress state to derive continuous throughput information from. Throughput will only show for units which have explicitly enabled it, it is opt-in.
This comes at the cost of additional memory and CPU time.
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.
stop_if_progress_missing: bool
If true (default: true), we will stop running the TUI once the progress isn’t available anymore (went out of scope).