[rust-dev] idea: specific visibility

Graydon Hoare graydon at mozilla.com
Mon Apr 9 11:02:23 PDT 2012


On 12-04-08 11:13 AM, Kobi Lurie wrote:

> this idea can be extended to functions, and checked by the compiler.
> for example, a member can declare that only the setter can change it.
> same thing for a getter.
> sometimes a dll has a lot of inter-related functionality inside, and you
> want a certain "internal" function to be visible, but only used by
> certain functions.

Rust has an visibility-control system already in the form of 'export'.
It's going to be modified/rewritten in the near future either based on
this bug:

https://github.com/mozilla/rust/issues/1893

And/or this proposal:

https://mail.mozilla.org/pipermail/rust-dev/2012-March/001464.html

this will combine (hopefully) with the work on classes, outlined in this
bug:

https://github.com/mozilla/rust/issues/1726

-Graydon


More information about the Rust-dev mailing list