Macro fake::vec

source ·
macro_rules! vec {
    (@ty $t:ty) => { ... };
    (@ty $t:ty;) => { ... };
    (@ty $t:ty; $e:expr) => { ... };
    (@ty $t:ty; $e:expr, $($r:tt)*) => { ... };
    (@c $e:expr; $l:expr) => { ... };
    (@c $e:expr; $l:expr,) => { ... };
    (@c $e:expr; $l:expr, $($r:tt)*) => { ... };
    ($t:ty; $($l:tt)+) => { ... };
    ($t:ty as $e:expr; $($l:tt)+) => { ... };
}
Expand description

Creates a vec with fake values.

Requires T: Dummy<Faker> implementation for given type.

Examples

let a = fake::vec![u8; 4]; // random u8 of length 4
let b = fake::vec![u8; 4..8]; // random u8 of length 4 to 8
// let c = fake::vec![u8; 4..]; // this won't work