Struct prodash::render::tui::Options

source ·
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).

Trait Implementations§

source§

impl Clone for Options

source§

fn clone(&self) -> Options

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Options

source§

fn default() -> Self

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

Auto Trait Implementations§

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more