Given the struct:
#[derive(Debug, Serialize)] pub struct ReqMetrics { start: Timespec, pub name: String } How can I ensure that Serde ignores the field start when serializing?
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesStack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Explore Stack InternalGiven the struct:
#[derive(Debug, Serialize)] pub struct ReqMetrics { start: Timespec, pub name: String } How can I ensure that Serde ignores the field start when serializing?
The correct annotation is #[serde(skip_serializing)].