Using Field Attributes with serde.rs | by João Henrique Machado Silva | The Polyglot Programmer | Jul, 2021

Serde is a generic framework for serializing and deserializing Rust data structures efficiently.

use serde::{Serialize, Deserialize};/// Represents the Discord information as
/// returned from the API
///
#[derive(Debug, Serialize, Deserialize)]
pub struct DiscordUser {
pub photo_url: String,
pub username: String,
pub id: String,
}

Related posts

Celebrating Nowruz in the Digital Age: The Intersection of Technology and Spirituality

Google Pixel 9a:Performance and Value

Google Pixel 9a: The Unsung Hero of Budget Smartphones – Why It Deserves Your Attention

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Read More