The Phantom Builder in Rust

The Phantom Builder in Rust

A very popular method for constructing data structures in rust is referred to as the builder pattern. This is nice from an api design perspective because it allows the designer to set some logical default values while providing a convenient interface for construction. This all works just like it did before but remember we want to be able to allow our users to use this pattern without having to import the builder.

Source: wiredforge.com