termo_gen

Attribute Macro display

Source
#[display]
Expand description

§termo::display

display trait for termo makes a custom display for the struct with tree like structure and colors to make it easier to read example:

#[termo::display]
pub struct DedicatedCar {
  pub date: DateTime<Utc>,
  pub team: String,
  pub passengers: String,
  pub time: DateTime<Utc>,
  pub route: String,
  pub car_type: String,
  pub comments: String,
  pub daily_rate: f64,
  pub additional: f64,
  pub total_rate: f64,
  pub booking_ref: Option<String>,
}

will output something like this when printed

╭─ DedicatedCar ─────────
| date: 1970-01-01T00:00:00Z
| team: ""
| passengers: ""
| time: 1970-01-01T00:00:00Z
| route: ""
| car_type: ""
| comments: ""
| daily_rate: 0.0
| additional: 0.0
| total_rate: 0.0
| booking_ref: None
╰────────────────────────