We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, i want to make an json like this:
[ { "name": "name_01", "value": "funkyname", }, { "name": "name_02", "value": "notsofunkyname", } ]
and my database iterate the sql-query and put per iterate the name and the value name = name_01 value = funkyname
and the json must like json[0][name] json[0][value] json[1][name] json[1][value]
and so on
give it an easy way. build an mutable array or so?
thx
The text was updated successfully, but these errors were encountered:
Here you go:
#[derive(serde::Serialize)] struct Item { name: String, value: String, } let data = vec![ Item { name: "name_01".into(), value: "funkyname".into() }, Item { name: "name_02".into(), value: "notsofunkyname".into() }, ]; println!("{}", serde_json::to_string(&data).unwrap());
Sorry, something went wrong.
No branches or pull requests
Hello,
i want to make an json like this:
and my database iterate the sql-query and put per iterate the name and the value
name = name_01
value = funkyname
and the json must like
json[0][name]
json[0][value]
json[1][name]
json[1][value]
and so on
give it an easy way. build an mutable array or so?
thx
The text was updated successfully, but these errors were encountered: