Access Levels

The access level of a declared element is the limits of access it gives to other elements. That is, what code is permitted to read it and write to it. This is not only given by which type of element you use, but also by the access level of the element's container. If code cannot get access to a container, then it cannot get access to elements in that container.

Access LevelElements
Code that can see the element can get access to it.
  • Class
  • Constructor
  • Destructor
  • Enum
  • Event
  • Method
  • Property
  • Struct
  • Struct member
  • Trait
  • Unit
Code in the same container can get access to the element.
  • Class member variable
  • Const
  • Function
  • Sub

See also