rust-typed-builder
rust-typed-builder copied to clipboard
Calling some methods on the builder type directly without calling `.build()`
I use the builder pattern mainly to emulate named arguments. But I don't want to have to call build
.
What I must do currently
DoSomething::builder()
.foo(foo)
.bar(bar)
.build() // <- I want to remove this
.run()
.await // the `into` attribute cannot handle opaque type such as `impl Future`, which was why calling `build` is the only way
What I hope for
DoSomething::builder()
.foo(foo)
.bar(bar)
.run() // this function captures DoSomethingBuilder by move
.await