deeply_nested/
deeply_nested.rs

1use derive_wizard::Wizard;
2
3#[derive(Debug, Wizard)]
4#[allow(unused)]
5struct GeoCoordinates {
6    #[prompt("Latitude:")]
7    latitude: f64,
8
9    #[prompt("Longitude:")]
10    longitude: f64,
11}
12
13#[derive(Debug, Wizard)]
14#[allow(unused)]
15struct Location {
16    #[prompt("Location name:")]
17    name: String,
18
19    #[prompt]
20    coordinates: GeoCoordinates,
21}
22
23#[derive(Debug, Wizard)]
24#[allow(unused)]
25struct Event {
26    #[prompt("Event title:")]
27    title: String,
28
29    #[prompt("Description:")]
30    description: String,
31
32    #[prompt]
33    location: Location,
34
35    #[prompt("Max attendees:")]
36    max_attendees: u32,
37}
38
39fn main() {
40    let event = Event::wizard_builder().build();
41    println!("{event:#?}");
42}