1
1
# Namespaces
2
2
3
- Entity names are segregated into separate * namespaces* based on the kind of
4
- entity that declared the name. The usage of a name will look for the
5
- declaration of that name in different namespaces, based on the context, as
6
- described in the [ name resolution] chapter.
3
+ A * namespace* is a set of [ names] where each name unambiguously refers to a
4
+ specific [ entity] . Namespaces are organized in a hierarchy, where each level
5
+ of the hierarchy has its own collection of named entities.
6
+
7
+ There are several different namespaces that each contain different kinds of
8
+ entities. The usage of a name will look for the declaration of that name in
9
+ different namespaces, based on the context, as described in the [ name
10
+ resolution] chapter.
7
11
8
12
The following is a list of namespaces, with their corresponding entities:
9
13
@@ -121,6 +125,7 @@ imported.
121
125
[ Constant item declarations ] : ../items/constant-items.md
122
126
[ Derive macro helpers ] : ../procedural-macros.md#derive-macro-helper-attributes
123
127
[ Derive macros ] : ../procedural-macros.md#derive-macros
128
+ [ entity ] : ../glossary.md#entity
124
129
[ Enum variant constructors ] : ../items/enumerations.md
125
130
[ enum ] : ../items/enumerations.md
126
131
[ External crate declarations ] : ../items/extern-crates.md
@@ -135,6 +140,7 @@ imported.
135
140
[ Loop labels ] : ../expressions/loop-expr.md#loop-labels
136
141
[ Module declarations ] : ../items/modules.md
137
142
[ name resolution ] : name-resolution.md
143
+ [ names ] : ../names.md
138
144
[ numeric ] : ../types/numeric.md
139
145
[ Static item declarations ] : ../items/static-items.md
140
146
[ Struct constructors ] : ../items/structs.md
0 commit comments