#![allow(dead_code)] use std::collections::{BTreeMap, BTreeSet}; use serde::Deserialize; #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Deserialize)] enum Bank { #[serde(rename = "N")] North, #[serde(rename = "W")] West, #[serde(rename = "E")] East, #[serde(rename = "S")] South, } #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Deserialize)] enum Person { #[serde(rename = "c1_OF_PERSON")] Cannibal1, #[serde(rename = "c2_OF_PERSON")] Cannibal2, #[serde(rename = "m1_OF_PERSON")] Missionary1, #[serde(rename = "m2_OF_PERSON")] Missionary2, } #[derive(Clone, Debug, Deserialize)] struct State { pub bank_of_boat: Bank, pub who_is_on_bank: BTreeMap>, } fn main() { let data = include_str!("../tests/fixtures/MissionariesAndCannibals.itf.json"); let trace: itf::Trace = itf::trace_from_str(data).unwrap(); dbg!(trace); }