pub struct Faker;
Expand description
Generate default fake value for given type using Fake
.
§Examples
use fake::{Fake, Faker};
let a: Option<usize> = Faker.fake();
// or use turbofish syntax
let b = Faker.fake::<Result<u32, u8>>();
let c: (u8, u32, f32) = Faker.fake();
// can also be combined with other values that implements Fake
let d: (u8, u32, f32) = (1..10, Faker, 2.5..5.5).fake();
let e: [u8; 3] = Faker.fake();
let f: String = Faker.fake();
// it also works for smart pointers and wrappers
let g: std::pin::Pin<String> = Faker.fake();
let h: Box<std::rc::Rc<u8>> = Faker.fake();
let i: std::path::PathBuf = Faker.fake();
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Faker
impl RefUnwindSafe for Faker
impl Send for Faker
impl Sync for Faker
impl Unpin for Faker
impl UnwindSafe for Faker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more