IronCoreLabs / ironoxide

Rust SDK for IronCore Privacy Platform
https://docs.rs/ironoxide
GNU Affero General Public License v3.0
10 stars 3 forks source link

Make CreateOpts fields public #263

Open skeet70 opened 2 years ago

skeet70 commented 2 years ago

Right now you either enumerate all the fields on a struct, or use default to get only defaults. Neither of those is super useful, most likely you just want a few fields set at a time and everything else default. Making fields public would enable the normal pattern of

GroupCreateOpts {
    name: Some("word up".to_string()),
    ..Default::default()
}
BobWall23 commented 2 years ago

Didn't want to make fields public so that we can force validation. Need to investigate alternatives - builder pattern might work. Might be able to make fields public if the right validation pattern is available.

BobWall23 commented 2 years ago

Once we figure out a pattern, should probably do the same for other larger Opt structs.