6 releases

0.1.5 Dec 23, 2019
0.1.4 Dec 23, 2019

#174 in Email

MIT license

9KB
204 lines

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

No runtime deps