promptput 0.1.1

A simple crate for handling terminal input.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 2.69 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.05 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • guymarshall/promptput
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • guymarshall

Promptput

Promptput is a simple and intuitive crate for handling terminal user input in Rust. It allows you to prompt the user with a message and capture their input as the desired data type. It is inspired by the input() method in Python.

Installation

Add this to your Cargo.toml:

[dependencies]
promptput = "0.1"

Usage

Here's a simple example of how to use promptput:

use promptput::input;

fn main() {
    let name: &str = input("Name: ");
    let age: i32 = input("Age: ");

    println!("Name: {name}, Age: {age}");
}

How it Works

The input() function takes a prompt &str and returns the user input, automatically converting it into the specified data type.

Contributing

Feel free to open issues or submit pull requests if you have any improvements or suggestions.