How to write an idiomatic build pattern with chained method calls in Rust?
问题 Based on the following examples, its possible to write a build-pattern with chained method calls in Rust which either passes by value or by reference (with a lifetime specifier) Is it possible to create a macro to implement builder pattern methods? How to overload the 'new' method? (top answer) https://github.com/rust-unofficial/patterns/blob/master/patterns/builder.md A builder pattern in Rust may look something like this: ui::Button::new() .label("Test") .align(Align::Center) .build(); When