// #[derive(Debug)] // enum VRRPv2State { // Initialize, // Backup, // Master, // } // struct StateMachine { // state: VRRPv2State, // } // impl StateMachine { // fn new() -> Self { // StateMachine { // state: VRRPv2State::Initialize, // } // } // fn transit_to(&mut self, new_state: VRRPv2State) { // std::println!("vvrpd: {:?} -> {:?}", self.state, new_state); // self.state = new_state; // } // } fn main() { // let mut sm = StateMachine::new(); // sm.transit_to(VRRPv2State::Master); // sm.transit_to(VRRPv2State::Backup); }