Crate serde_str[−][src]
Expand description
Serde Str
Documentation | Github | Crate
A (de)serializer for anything that has implemented FromStr
/ Display
but does not have Serialize
/Deserialize
.
Example
#[macro_use]
extern crate serde_derive;
extern crate serde;
extern crate serde_str;
use std::net::IpAddr;
#[derive(Serialize, Deserialize)]
struct Timestamps {
#[serde(with = "serde_str")]
pattern: IpAddr,
}
Functions
Deserialize function, see crate docs to see how to use it
Serialize function, see crate docs to see how to use it