6 releases
0.1.5 | Dec 23, 2019 |
---|---|
0.1.4 | Dec 23, 2019 |
#172 in Email
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 paramsfirst_name
,last_name
, andloop_by
. -
create_name
to create a single data name with paramsfirst_name
,last_name
. -
struct
Name
increate_name
have are two methodsfullname
to get fullname andreverse
to reverse text of name.
-
create_emails
to create collections data of emails with paramsemail
, andloop_by
. -
create_email
to create a single data email with paramemail
.
Text
create_text
to create collections data of text with paramstitle
,description
andloop_by
.
Address
create_address
to create collections data of address with paramsaddress
andloop_by
.
License
MIT