This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct Game { | |
score: u32, | |
rolls: Vec<u32>, | |
} | |
impl Game { | |
pub fn new() -> Game { | |
Game { | |
score: 0, | |
rolls: vec![], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::marker::PhantomData; | |
struct Reserved; | |
struct Cooking; | |
struct Delivering; | |
struct Arrived; | |
struct FoodDelivery<State = Reserved> { | |
state: PhantomData<State>, | |
} |