Expand description
--watch mode: continuously redraw terminal output at a fixed interval.
Callers pass in an async closure that renders one “frame” of output as a
String, a refresh interval in milliseconds, and an optional cancellation
receiver. The runner clears the screen, prints the rendered frame, waits
for the interval, then repeats. It exits cleanly on SIGINT (Ctrl-C) or
when the cancellation receiver fires.
Functions§
- run_
watch - Run
render_fnin a loop, refreshing the terminal everyinterval_msmilliseconds. Returns as soon as Ctrl-C is received or the optionalcancelchannel fires. - run_
watch_ secs - Convenience wrapper for production use (no cancel channel, interval in seconds).