pub struct Fake;Expand description
Implementations§
Source§impl Fake
impl Fake
Sourcepub fn first_name() -> String
pub fn first_name() -> String
Generate a random first name
Sourcepub fn safe_email() -> String
pub fn safe_email() -> String
Generate a safe email (always @example.com)
Sourcepub fn text(approx_length: usize) -> String
pub fn text(approx_length: usize) -> String
Generate random text of approximately the given length
Sourcepub fn boolean_with_probability(probability: f64) -> bool
pub fn boolean_with_probability(probability: f64) -> bool
Generate a random boolean with given probability of true
Sourcepub fn mac_address() -> String
pub fn mac_address() -> String
Generate a random MAC address
Sourcepub fn future_date() -> String
pub fn future_date() -> String
Generate a random future date
Sourcepub fn many_of<T: Clone>(items: &[T], count: usize) -> Vec<T>
pub fn many_of<T: Clone>(items: &[T], count: usize) -> Vec<T>
Pick n random elements from a slice
Sourcepub fn credit_card() -> String
pub fn credit_card() -> String
Generate a random credit card number (for testing only, not valid)
Auto Trait Implementations§
impl Freeze for Fake
impl RefUnwindSafe for Fake
impl Send for Fake
impl Sync for Fake
impl Unpin for Fake
impl UnsafeUnpin for Fake
impl UnwindSafe for Fake
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more