randir

Crates.iorandir
lib.rsrandir
version0.2.0
sourcesrc
created_at2020-05-16 06:26:21.702454
updated_at2022-09-12 08:03:39.991166
descriptionGenerates a directory with random names, telephone numbers & email addresses.
homepage
repositoryhttps://github.com/mibes/randir
max_upload_size
id242271
size50,986
Marcel (mibes)

documentation

README

randir

Generates a directory with random names, telephone numbers & email addresses.

Example use

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)
    }
}

Detail

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,
}

Importing

To use the random directory generator, you need to include it in the Cargo.toml file of your Rust project:

[dependencies]
randir = "0.2"
Commit count: 10

cargo fmt