How to return a ref to a struct?

technically there is no point having it private if you return a Ref anyway, since the whole point of private is no one else can access it.

the proper way to encapsulate it is just to create getter/setter functions

1 Like