Skip to main content

Module progress

Module progress 

Source
Expand description

Text progress bar builtins backed by the indicatif crate.

R’s utils::txtProgressBar API lets scripts report progress for long-running operations. This module stores progress bar state on the Interpreter struct as a Vec<Option<ProgressBarState>> — each bar is addressed by its index in this Vec. The R side sees an integer ID with class "txtProgressBar".

Builtins:

  • txtProgressBar(min, max, style) — create a bar, return integer ID
  • setTxtProgressBar(pb, value) — update the bar’s position
  • getTxtProgressBar(pb) — return the bar’s current value
  • close(pb) — finish and remove the bar (dispatched from the connection-layer close() when the argument has class "txtProgressBar")

Structs§

ProgressBarState
Per-bar state stored on the interpreter.

Statics§

__INTERP_REG_INTERP_GET_TXT_PROGRESS_BAR 🔒
__INTERP_REG_INTERP_SET_TXT_PROGRESS_BAR 🔒
__INTERP_REG_INTERP_TXT_PROGRESS_BAR 🔒

Functions§

interp_get_txt_progress_bar 🔒
Get the current value of a text progress bar.
interp_set_txt_progress_bar 🔒
Update a text progress bar’s position.
interp_txt_progress_bar 🔒
Create a text progress bar.
is_progress_bar
Returns true if val carries the "txtProgressBar" class attribute.
progress_bar_id 🔒
Extract a progress bar ID from an argument that carries class "txtProgressBar".
progress_bar_value 🔒
Build an integer scalar with class "txtProgressBar" representing bar id.
style_for 🔒
Build an indicatif ProgressStyle for the given R style number.
value_to_position 🔒
Map an R-level value in [min, max] to a u64 position in [0, total].