rust-faker

Crates.iorust-faker
lib.rsrust-faker
version0.1.5
sourcesrc
created_at2019-12-22 16:24:23.703749
updated_at2019-12-23 08:34:47.1919
descriptioncreate fake data with rust
homepage
repositoryhttps://github.com/adiatma/rust-faker.git
max_upload_size
id191508
size9,120
Adiatma Kamarudin (adiatma)

documentation

README

rust-faker

Create fake data with rust
🦀 + 😎 = 💖

Usage

extern crate rust_faker;

use rust_faker::{create_names};

fn main() {
  println!("{:?}", create_names("Adiatma", "Kamarudin", 2).unwrap()); // [Name{ first_name: "Adiatma", last_name: "Kamarudin" }, Name{ first_name: "Adiatma", last_name: "Kamarudin" }]

  for name in create_names("Adiatma", "Kamarudin", 2).unwrap() {
    println!("{:?}", name.fullname()) // "Adiatma Kamarudin"
  }

  for name in create_names("Ad", "Ka", 2).unwrap() {
    println!("{:?}", name.reverse().unwarp()) // "aK dA"
  }
}

API references

Name

  • create_names to create collections data of names with params first_name, last_name, and loop_by.

  • create_name to create a single data name with params first_name, last_name.

  • struct Name in create_name have are two methods fullname to get fullname and reverse to reverse text of name.

Email

  • create_emails to create collections data of emails with params email, and loop_by.

  • create_email to create a single data email with param email.

Text

  • create_text to create collections data of text with params title, description and loop_by.

Address

  • create_address to create collections data of address with params address and loop_by.

License

MIT

Commit count: 0

cargo fmt