Skip to content

An annotation to implement #[serde(default)] and Default.

License

Apache-2.0, MIT licenses found

Licenses found

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

enzious/smart-serde-default

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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,
}

About

An annotation to implement #[serde(default)] and Default.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE.md
MIT
LICENSE-MIT.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages