formations 0.1.0

A terminal forms/multiple choice library
Documentation
  • Coverage
  • 50%
    4 out of 8 items documented1 out of 5 items with examples
  • Size
  • Source code size: 23.74 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 336.62 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 25s Average build duration of successful builds.
  • all releases: 25s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • john_t/formations
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • John-Toohey

Formations

Formations is a rust library to allow you to easily create terminal forms, where a user is presented with multiple options and has to pick one. It looks something like:

1) Option 1  2) Option 2
3) Option 3  4) Option 4

It can be programmed as follows:

use formations::FormElement;

fn main() -> std::io::Result<()> {
    println!("Pick your favourite pet.");
    let mut form = vec![
        FormElement::new("cat", "Small mammal with fur"),
        FormElement::new("dog", "Likes a bone"),
        FormElement::new("mouse", "Likes cheese"),
    ];
    println!("{}", FormElement::run(&form)?.description.unwrap());

    Ok(())
}