Skip to main content

Crate read_int

Crate read_int 

Source
Expand description

§Read_int

A simple Rust crate for getting user input

§About

This crate was made for helping in getting user inputs in others types!
Supported types:

  • generic_read:
    • unsigned
    • signed
    • float
  • vec_read:
    • unsigned
    • signed
    • float
    • bool
    • char
    • String

§Functions:

§Numbers:

image
  • This function receives a generic type (T) (all numbers type), and return a Option with the same type.
  • You can also gives the function a text to display to user.

§Bool:

image
  • This function return a bool value (true or false).
  • Like the other function, you can also gives a text to display to user.
  • To receive TRUE , the user need to write (yes or YES), any other words will return FALSE.

§Vector:

image
  • This function receives a generic type (T) for a vector, and return a Option of a vector with the same type.
  • Like any other function in Read_int, you can pass a text to display to user.
  • This function accept all types included in the SUPPORTED TYPES, and the input need a space between each other!
  • E.g: image

Functions§

bool_read
Function to get bool value from user input!
generic_read
Function to get a numeric value “T” from user input!
vec_read
Function to get vector from a numeric type