catch-input 1.1.2

Library implementing a macro for retrieving user input from the console.
Documentation
  • Coverage
  • 50%
    2 out of 4 items documented2 out of 2 items with examples
  • Size
  • Source code size: 6.01 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.07 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
  • c1m50c/catch-input
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • c1m50c

catch-input

Crates.io Version Crates.io License Lines of Code

Rust library implementing a macro for retrieving user input from the console.

Example

use catch_input::input;

fn main() {
    let a = input!("PromptA => ");
    let b = input!(|| { print!("PromptB => ") });
    let c = input!((String::from("PromptC => ")));

    assert!(a, String::from("Catch"));
    assert!(b, String::from("Input"));
    assert!(c, String::from("Crate"));

    println!(">> {} : {} : {}", a, b, c);
}
$ cargo run

...


PromptA => Catch

PromptB => Input

PromptC => Crate

>> Catch : Input : Crate