tty-overwriter 0.1.0

A lib to ease overwriting text in stdout. Make a body, then overwrite it as much as needed.
Documentation
  • Coverage
  • 100%
    30 out of 30 items documented2 out of 10 items with examples
  • Size
  • Source code size: 22.26 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.5 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • PierreAntoineGuillaume/tty-overwriter
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • PierreAntoineGuillaume

TTY Overwriter

TTY Overwriter the crate is a small library consisting of two modules : ansi_seq and ̀body

  • ansi_seq are ansi_sequences to be Written.
  • body is a small tool which uses ansi sequences to rewrite text to a terminal in a loop without flickering.

The lib is thought to be small (under 1k lines) and with no direct dependencies ; though the third arguments of Body.overwrite may be easily provided by a crate like term_size, as shown in the replace-body example.

let mut body = Body::default();
body.overwrite("my text", &mut std::io::stdout(), 80);
body.overwrite("replacement of my text.", &mut std::io::stdout(), 80);

Examples

How to use Body.

cargo run --example replace-body

How to use AnsiSeq.

cargo run --example replace-paragraph