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.
SerializeWith
✓ use serde_field_with::SerializeWith;
Use custom serialization for a field
use serde::{Serialize, Deserialize};
use serde_field_with::SerializeWith;
#[derive(Serialize)]
struct MyStruct {
#[serde(with = "SerializeWith")]
field: String,
}
fn main() {
let s = MyStruct { field: "hello".to_string() };
println!("{}", serde_json::to_string(&s).unwrap());
}
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.