在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:callum-oakley/json5-rs开源软件地址:https://github.com/callum-oakley/json5-rs开源编程语言:Rust 100.0%开源软件介绍:JSON5A Rust JSON5 serializer and deserializer which speaks Serde. APIDeserialize a JSON5 string with The Serde data model is mostly supported, with the exception of bytes and borrowed strings. ExampleRead some config into a struct. use json5;
use serde_derive::Deserialize;
#[derive(Deserialize, Debug, PartialEq)]
struct Config {
message: String,
n: i32,
}
fn main() {
let config = "
{
// A traditional message.
message: 'hello world',
// A number for some reason.
n: 42,
}
";
assert_eq!(
json5::from_str(config),
Ok(Config {
message: "hello world".to_string(),
n: 42,
}),
);
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论