The general rule is that things appear in the same order as in the definition, so it'll look something like this:
enum Suit {
Club,
Diamond,
Heart,
Spade,
}
enum Rank{
Value(u8),
Jack,
Queen,
King,
Ace,
}
struct Card {
rank: Rank,
suit: Suit,
}
struct Deck {
cards: Vec<Card>,
}
fn main() {
let deck = Deck { // Deck is the overall type we're building
cards: vec![ // Dec.cards is a vector
Card { // Each vector element is a Card
rank: Rank::Value(1), // Card.rank is a Rank
suit: Suit::Heart, // Card.suit is a Suit
},
Card { rank: Rank::Queen, suit: Suit::Spade },
/* ... more cards ... */
],
};
}