mock-rs

Crates.iomock-rs
lib.rsmock-rs
version0.3.0
sourcesrc
created_at2022-06-19 15:14:13.837884
updated_at2022-08-15 05:04:04.357839
descriptionA Rust crate for generating fake data inspired by FakerPHP
homepage
repositoryhttps://github.com/babalolajnr/mock-rs
max_upload_size
id608983
size225,827
Abdulqudduus Babalola (babalolajnr)

documentation

README

mock-rs

A Rust crate to generate fake data inspired by FakerPHP. The crate is still under development and it is not stable yet. So a lot of thing might change in the future.

Structure

The crate is divided into providers. A provider is a module that represents a particular locale. A provider contains sub-providers for that particular locale The available locales right now are: en_us and universal. Many more are going to be added in the future.

Examples

en_us Person provider

use mock_rs::{en_us::Person, PersonTrait, Gender};

// Initialize `en_us` person
let en_us_person = Person::new(); 

// Get random en_us male_name
let male_name = en_us_person.name(Some(Gender::Male));
println!("{}", male_name);

// Get random en_us female_name
let female_male_name = en_us_person.name(Some(Gender::Female));
println!("{}", female_male_name);


Commit count: 267

cargo fmt