fieldx 0.2.3

Procedural macro for constructing structs with lazily initialized fields, builder pattern, and serde support with a focus on declarative syntax.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use fieldx::fxstruct;

// It's OK for this test just to compile.

#[fxstruct]
struct Foo {
    #[allow(unused)]
    f1: u32,
    #[fieldx(builder)]
    f2: u32,
}

#[test]
fn builder() {
    let foo = Foo::builder().f2(42).build().unwrap();
    assert_eq!(foo.f2, 42);
}