9 个版本
| 0.1.8 | 2021 年 8 月 22 日 |
|---|---|
| 0.1.7 | 2021 年 2 月 27 日 |
| 0.1.6 | 2020 年 4 月 10 日 |
#202 in #interactive
21 每月下载
用于 ibuilder
67KB
1.5K SLoC
ibuilder_derive
有关详细信息,请参阅 ibuilder 的文档,你可能正在寻找那个。
ibuilder derive 宏
用法
#[derive(IBuilder)]
struct Example {
field1: i64,
#[ibuilder(default = "something")]
field2: String,
}
将为 ibuilder::Buildable 实现 trait,为 Example 提供 builder() 方法来获取 ibuilder::Builder。
它还将实现一个私有结构来保持构建器的状态,并为 Example 实现 NewBuildableValue trait,允许它成为其他派生类型的字段。
许可证:MIT
lib.rs:
有关详细信息,请参阅 ibuilder 的文档,你可能正在寻找那个。
ibuilder derive 宏
用法
#[derive(IBuilder)]
struct Example {
field1: i64,
#[ibuilder(default = "something")]
field2: String,
}
将为 ibuilder::Buildable 实现 trait,为 Example 提供 builder() 方法来获取 ibuilder::Builder。
它还将实现一个私有结构来保持构建器的状态,并为 Example 实现 NewBuildableValue trait,允许它成为其他派生类型的字段。
依赖项
~1.5MB
~36K SLoC