enum_transport/
enum_transport.rs

1use derive_wizard::Wizard;
2
3/// Bike type - Road or Mountain
4#[derive(Debug, Wizard)]
5enum BikeType {
6    Road,
7    Mountain,
8}
9
10/// Different modes of transportation
11#[derive(Debug, Wizard)]
12#[allow(unused)]
13enum Transport {
14    Car {
15        #[prompt("Model:")]
16        model: String,
17
18        #[prompt("Year:")]
19        year: u32,
20    },
21
22    Bicycle {
23        #[prompt("Bike type:")]
24        typ: BikeType,
25
26        #[prompt("Number of gears:")]
27        gears: u8,
28    },
29
30    Walk,
31}
32
33fn main() {
34    let transport = Transport::wizard_builder().build().unwrap();
35    println!("Transport: {:#?}", transport);
36}