enum Visibility
Visibility of a field or method as seen by comptime reflection (§2.3, §15.2, D-1908).
Example:
data Account {
pub(api) id: i64
secret: str
}
fn main() io {
inline for f in reflect(Account).fields {
print("{f.name} public={f.visibility == Visibility.PubApi}")
}
}Вывод
id public=true secret public=false
pub(api) enum VisibilityС версии. 1.0.0-beta
Варианты
Private | Visible in the declaring module only. |
Pub | Visible in the package. |
PubApi | Part of the public API of the package. |
Определено в: std/core/types.oxl:615