You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there is a pub attribute for a struct field, the field can be accessible from external. Otherwise, the private fields are only accessible in the struct methods.
The text was updated successfully, but these errors were encountered:
For struct fields, sometimes we want to control the accessibility of the fields, so they are only accessible within the struct methods.
For example:
When there is a
pub
attribute for a struct field, the field can be accessible from external. Otherwise, the private fields are only accessible in the struct methods.The text was updated successfully, but these errors were encountered: