1 unstable release
0.1.1 | Jun 21, 2024 |
---|---|
0.1.0 |
|
#499 in Procedural macros
6KB
56 lines
smart-serde-default
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,
}
Dependencies
~220–660KB
~16K SLoC