pub async fn run_watch<F, Fut>(
interval_ms: u64,
render_fn: F,
cancel: Option<Receiver<()>>,
) -> Result<()>Expand description
Run render_fn in a loop, refreshing the terminal every interval_ms
milliseconds. Returns as soon as Ctrl-C is received or the optional
cancel channel fires.
§Arguments
interval_ms— refresh interval in milliseconds (clamped to ≥1 ms)render_fn— async closure that returns a frame string or an errorcancel— optional oneshot receiver; when it fires the loop exits