cargo serde_yaml 0.8.16

latest releases: 0.9.34+deprecated, 0.9.34-deprecated, 0.9.33...
3 years ago
  • 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);
    }

Don't miss a new serde_yaml release

NewReleases is sending notifications on new releases.