Hacker News new | ask | show | jobs
by ginsider_oaks 1271 days ago
Sure, just make the fields of the struct private and you can make a public constructor:

https://doc.rust-lang.org/rust-by-example/mod/struct_visibil...

1 comments

Yeah weird question because you can use the exact same style in C++.