[][src]Crate easy_adds

Introduction

Easy Adds is a crate which provides simple rust for beginers and schools Rust is not an easy langage for beginers but with this crate they can do cool things without dificulty

For using this library writte this in the first line of your code

extern crate easy_adds;
use easy_adds::*;

Some usefull functions

// Generate a random number between 0 and 1
random_f64()
// NOTE: You can also use random_f32 which return a f32 number instead of a f64 number
// You can also generate a number between two numbers with:
random(-5,5)
// This function returns a i32 between the first and the second number (NOTE: The first number is included but not the second)
 
// Get an input form the user of the given type ex: input_i64("Type a number: ")
input_<Type>("Mesage to sended to the user")
// Here all the types supported: f32,f64,bool,i8,i16,i32,i64,u8,u16,u32,u64,string
// Note to make a string input: input("Mesage to sended to the user")
// You can also use the try_ statement to get an Option<Type> like:
try_input_<Type>("Mesage to sended to the user")
// This return an option of the given type an this is avaible for all types of the input expect String

Functions

input

This function take a String input from the user like input_str and input_string

input_bool

This function take a bool input from the user and return an bool return false if there are an bad input

input_f32

This function take a f32 input from the user and return an f32 but panic if bad input

input_f64

This function take a f64 input from the user and return an f64 but panic if bad input

input_i8

This function take a i8 input from the user and return an i8 but panic if bad input

input_i16

This function take a i16 input from the user and return an i16 but panic if bad input

input_i32

This function take a i32 input from the user and return an i32 but panic if bad input

input_i64

This function take a i64 input from the user and return an i64 but panic if bad input

input_str

This function take a String input from the user like input and input_string

input_string

This function take a String input from the user like input and input_str

input_u8

This function take a u8 input from the user and return an u8 but panic if bad input

input_u16

This function take a u16 input from the user and return an u16 but panic if bad input

input_u32

This function take a u32 input from the user and return an u32 but panic if bad input

input_u64

This function take a u64 input from the user and return an u64 but panic if bad input

random

This function generate random i32 between i32 start and end Based on top of rand crate

random_f32

This function generate random f32 between 0 and 1. Based on top of rand crate.

random_f64

This function generate random f64 between 0 and 1. Based on top of rand crate.

try_input_bool

This function take a bool input from the user and return an Option

try_input_f32

This function take a f32 input from the user and return an Option

try_input_f64

This function take a f64 input from the user and return an Option

try_input_i8

This function take a i8 input from the user and return an Option

try_input_i16

This function take a i16 input from the user and return an Option

try_input_i32

This function take a i32 input from the user and return an Option

try_input_i64

This function take a i64 input from the user and return an Option

try_input_u8

This function take a u8 input from the user and return an Option

try_input_u16

This function take a u16 input from the user and return an Option

try_input_u32

This function take a u32 input from the user and return an Option

try_input_u64

This function take a u64 input from the user and return an Option