Crates.io | auto-builder |
lib.rs | auto-builder |
version | 0.2.0 |
source | src |
created_at | 2024-01-20 16:27:05.267187 |
updated_at | 2024-01-21 22:17:54.508051 |
description | A derive macro to implement the builder pattern for any struct |
homepage | |
repository | https://github.com/hollg/auto-builder |
max_upload_size | |
id | 1106591 |
size | 3,754 |
This crate provides a derive macro that implements the builder pattern for any struct.
#[derive(Builder)]
struct Foo {
a: i32,
b: Option<i32>,
}
let foo = FooBuilder::new().a(1).b(Some(2)).build();
assert!(foo.is_ok());