Skip to content

A serde wrapper, that can be used to serialize data types using Display and FromStr

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
Unknown
LICENSE-MIT
Notifications You must be signed in to change notification settings

ZaneHannanAU/serde-str

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serde Str

Documentation | Github | Crate

A serde wrapper, that can be used to serialize data types using Display (or .to_string()) and FromStr.

Example

#[macro_use]
extern crate serde_derive;

extern crate serde;
extern crate serde_str;

use std::net::IpAddr;

#[derive(Serialize, Deserialize)]
struct Struct {
    /// By default IpAddr is serialized the same in human-readable formats
    /// like json. This forces the impl even for binary formats.
    ///
    /// More inporantly this is useful for types which don't have serde impl.
    #[serde(with = "serde_str")]
    ip: IpAddr,
}

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

A serde wrapper, that can be used to serialize data types using Display and FromStr

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
Unknown
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%