Code Monkey home page Code Monkey logo

Comments (3)

killercup avatar killercup commented on May 24, 2024

I was using this crate recently and noticed how its docs were not as awesome as serde_json, but could probably be very similar to those of serde_json. I'll try to update some code to serde 1.0 later, and maybe also have time to add some docs here.

from serde-yaml.

Zteve avatar Zteve commented on May 24, 2024

In particular could you document how a tuple-struct is derive-serialised?

from serde-yaml.

Akaame avatar Akaame commented on May 24, 2024

Copying the example from serde_json on "Operating on untyped JSON values" would not work on serde_yaml as std::fmt::Display is not implemented by serde_yaml::Value.

use serde_yaml::{Result, Value};

fn main() -> Result<()> {
    let data = r#"
        name: "John Doe"
        age: 43
        phones:
            - "+44 1234567"
            - "+44 2345678"
        "#;
    let val: Value = serde_yaml::from_str(data)?;
    println!("Please call {} at the number {}", val["name"], val["phones"][0]); 
    // `Value` doesn't implement `std::fmt::Display`

    Ok(())
}

serde_json's implementation

from serde-yaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.