elastio/ssstar

Add a Builder pattern to `Config`

Opened this issue · 0 comments

In a PR elastio/elastio#6680 it became clear that because Config is marked non_exhaustive, the Config struct can't be initialized the normal way. Instead an ugly mut was used, so the Default() struct could be permuted with the appropriate config options.

This works fine but it's not particularly idiomatic or pleasant. A builder should be added for Config so that this type can be constructed without mutable state, while retaining the non_exhaustive attribute that is important for future flexibility.