Seeing a pattern emerge in #rustlang struct design. Pub fields plus a zero sized _priv: () field. What is this pattern called and why does it exist?
-
-
Replying to @softprops
Name? No idea. Purpose? Allow access, but not construction.
1 reply 0 retweets 1 like -
Replying to @badboy_
Have a vauge hunch it has to do with API compatibility. Found this SO post but it seems like an official pattern. Just can't find docs calling it out https://stackoverflow.com/questions/39277157/updating-public-fields-of-rust-structs-which-have-private-fields …
1 reply 0 retweets 0 likes
Replying to @softprops @badboy_
It’s related. If you can’t literally construct, you can prevent match and therefore have compatibility
1:24 PM - 11 Jan 2018
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.