-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
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
derive Serialize Deserialize macros #4
Comments
@xlc I want to try to tackle this issue. Currently, I am using code here to get a certain value/object out from use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize, Debug)]
struct Point {
x: i32,
y: i32,
}
fn main() {
let point = Point { x: 1, y: 2 };
let serialized = serde_json::to_string(&point).unwrap();
println!("serialized = {}", serialized);
let deserialized: Point = serde_json::from_str(&serialized).unwrap();
println!("deserialized = {:?}", deserialized);
// So in lite-json
let deserialized2: Point = lite_json::parse_json(&serialized).unwrap().deserialize().unwrap();
} I am still not sure about the implementation yet. How hard would it be to do something like this in |
@jimmychu0807 I have started it at #13 and you are welcome to finish it. You can PR into Current status is it compiles, but I never ran it once so likely missing a lot of details. The code is heavily inspired by parity-scale-codec. |
Thanks. Let me take a look |
I would love to see this 🤞 |
Add derive macro to for auto serialization and deserialization implementation generation.
The text was updated successfully, but these errors were encountered: