2
2
3
3
An _ implementation_ is an item that associates items with an * implementing type* .
4
4
5
- There are two types of implementations: Bare implementations and [ trait]
5
+ There are two types of implementations: inherent implementations and [ trait]
6
6
implementations.
7
7
8
8
Implementations are defined with the keyword ` impl ` .
9
9
10
- ## Bare Implementations
10
+ ## Interent Implementations
11
11
12
- A bare implementation is defined as the sequence of the ` impl ` keyword, generic
13
- type declarations, a path to a nomial type, a where clause, and a bracketed
14
- set of associable items.
12
+ An inherent implementation is defined as the sequence of the ` impl ` keyword,
13
+ generic type declarations, a path to a nomial type, a where clause, and a
14
+ bracketed set of associable items.
15
15
16
16
The nominal type is called the * implementing type* and the associable items are
17
17
the * associated items* to the implementing type.
18
18
19
- Bare implementations associate the associated items to the implementing type.
19
+ Inherent implementations associate the associated items to the implementing
20
+ type.
20
21
21
22
The associated item has a path of a path to the implementing type followed by
22
23
the associate item's path component.
23
24
24
- Bare implementations cannot contain associated type aliases.
25
+ Inherent implementations cannot contain associated type aliases.
25
26
26
- A type can have multiple bare implementations.
27
+ A type can have multiple inherent implementations.
27
28
28
29
The implementing type must be defined within the same crate.
29
30
@@ -42,8 +43,8 @@ my_point.log();
42
43
43
44
## Trait Implementations
44
45
45
- A * trait implementation* is defined like a bare implementation except that
46
- the optional generic type declarations is followed by a trait followed
46
+ A * trait implementation* is defined like an inherent implementation except that
47
+ the optional generic type declarations is followed by a [ trait] followed
47
48
by the keyword ` for ` . <!-- To understand this, you have to back-reference to
48
49
the previous section. :( -->
49
50
0 commit comments