Registry / serialization / serde-derive

serde-derive

JSON →
library1.0.228rscratesunverified

Provides #[derive(Serialize, Deserialize)] macros for Serde.

# Cargo.toml [dependencies] serde_derive = "1.0.228"
INSTALL
IMPORT
SIG · SERDE-DERIVE
S
serde-derive
serializationrustv1.0.228
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Serialize
use serde::{Serialize, Deserialize};

Derive Serialize and Deserialize for a struct.

use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize)] struct Point { x: i32, y: i32, } fn main() { let point = Point { x: 1, y: 2 }; let json = serde_json::to_string(&point).unwrap(); println!("{}", json); }
Debug
Known issues
gotchaserde_derive is a proc-macro crate; it must be listed as a dependency separately from serde.
fix
Add both serde and serde_derive to Cargo.toml, or use serde with the "derive" feature.
affects: >=1.0.0
Upgrade
Version history
1.0.228latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
serde-derive — cargo add serde-derive · libregistry