use chrono::{DateTime, Utc}; use fake::{Dummy, Fake, Faker}; use positional::{FromPositionalRow, ToPositionalRow, Writer}; #[derive(ToPositionalRow, FromPositionalRow, Dummy, Debug)] struct Data { #[field(size = 25)] name: String, #[field(size = 25)] surname: String, #[field(size = 40, filler = '_', align = "right")] created: DateTime, #[field(size = 40, filler = '+', align = "right")] updated_at: Option>, } pub fn main() { let mut rows: Vec = vec![]; for _ in 1..=100 { rows.push(Faker.fake()) } let positional_file = Writer::new(rows); let output = positional_file.to_string(); println!("{}", &output); }