use serde::Deserialize; use serde_json; #[derive(Deserialize)] struct Person { name: String, age: u8, email: String, } fn main() { let json_data = r#" { "name": "Sara", "age": 25, "email": "sara@example.com" } "#; let person: Person = serde_json::from_str(json_data).unwrap(); println!("Name: {}, Age: {}, Email: {}", person.name, person.age, person.email); }