Crates.io | randir |
lib.rs | randir |
version | 0.2.0 |
source | src |
created_at | 2020-05-16 06:26:21.702454 |
updated_at | 2022-09-12 08:03:39.991166 |
description | Generates a directory with random names, telephone numbers & email addresses. |
homepage | |
repository | https://github.com/mibes/randir |
max_upload_size | |
id | 242271 |
size | 50,986 |
Generates a directory with random names, telephone numbers & email addresses.
use randir::utils::generate_entries;
fn main() {
// generate 100 random names, telephone numbers & email addresses
let directory = generate_entries(100);
for entry in directory {
println!("{}", entry)
}
}
The result type of the generate_entries()
function is a Vec<Entry>
. Entry
is defined as:
pub struct Entry {
pub uid: usize,
pub first_name: String,
pub last_name: String,
pub phone_nr: String,
pub email: String,
}
To use the random directory generator, you need to include it in the Cargo.toml
file of your Rust project:
[dependencies]
randir = "0.2"