-
Add a Serializer and Deserializer type (#185, #186)
let mut buffer = Vec::new(); let mut ser = serde_yaml::Serializer::new(&mut buffer); let mut object = BTreeMap::new(); object.insert("k", 107); object.serialize(&mut ser)?; let de = serde_yaml::Deserializer::from_slice(&buffer); let value = Value::deserialize(de)?; println!("{:?}", value);
-
Support multi-doc serialization (#187)
let mut buffer = Vec::new(); let mut ser = serde_yaml::Serializer::new(&mut buffer); let mut object = BTreeMap::new(); object.insert("k", 107); object.serialize(&mut ser)?; object.insert("j", 106); object.serialize(&mut ser)?; assert_eq!(buffer, b"---\nk: 107\n...\n---\nj: 106\nk: 107\n");
-
Support multi-doc deserialization (#189)
let input = "---\nk: 107\n...\n---\nj: 106\n"; for document in serde_yaml::Deserializer::from_str(input) { let value = Value::deserialize(document)?; println!("{:?}", value); }