Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 1.33 KB

crates-io.md

File metadata and controls

32 lines (25 loc) · 1.33 KB

smart-serde-default

License Contributors GitHub Repo stars crates.io

A crate that basically extends the serde-inline-default and smart-default crates functionality to allow you to specify a default for both std::default::Default and serde with one annotation.

Documentation

Defining defaults

#[smart_serde_default]
#[derive(Debug, Deserialize, Serialize, SmartDefault)]
pub struct FuzionRedisConfigBuilder {
  #[smart_default(String::from("127.0.0.1"))]
  host: String,

  #[smart_default(6379)]
  port: u16,
}