You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for json, toml etc support and I was wondering if you guys have your own methods to deserialize by any chance? For example in this code:
use serde::{Serialize,Deserialize};#[derive(Serialize,Deserialize,Debug)]structPoint{x:i32,y:i32,}fnmain(){let point = Point{x:1,y:2};// Convert the Point to a JSON string.let serialized = serde_json::to_string(&point).unwrap();// Prints serialized = {"x":1,"y":2}println!("serialized = {}", serialized);// Convert the JSON string back to a Point.let deserialized:Point = serde_json::from_str(&serialized).unwrap();// Prints deserialized = Point { x: 1, y: 2 }println!("deserialized = {:?}", deserialized);}
See how they deserialize? Do you guys have something similar? If so then can you please provide me an example?
If not do you guys plan to make something like this in the future?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am looking at this crate
https://crates.io/crates/serde
for json, toml etc support and I was wondering if you guys have your own methods to deserialize by any chance? For example in this code:
See how they deserialize? Do you guys have something similar? If so then can you please provide me an example?
If not do you guys plan to make something like this in the future?
Beta Was this translation helpful? Give feedback.
All reactions