File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 268
268
- [ 関数] ( scope/lifetime/fn.md )
269
269
- [ メソッド] ( scope/lifetime/methods.md )
270
270
- [ 構造体] ( scope/lifetime/struct.md )
271
- - [ Traits ] ( scope/lifetime/trait.md )
271
+ - [ トレイト ] ( scope/lifetime/trait.md )
272
272
- [ ライフタイム境界] ( scope/lifetime/lifetime_bounds.md )
273
273
- [ 圧縮] ( scope/lifetime/lifetime_coercion.md )
274
274
- [ スタティックライフタイム] ( scope/lifetime/static_lifetime.md )
Original file line number Diff line number Diff line change
1
+ <!--
1
2
# Traits
3
+ -->
4
+ # トレイト
2
5
6
+ <!--
3
7
Annotation of lifetimes in trait methods basically are similar to functions.
4
8
Note that `impl` may have annotation of lifetimes too.
9
+ -->
10
+ トレイトのメソッドにおけるライフタイムのアノテーションは、
11
+ 基本的には関数に似ています。
12
+ ` impl ` にもライフタイムのアノテーションがあることに注意してください。
5
13
6
14
``` rust,editable
7
15
// A struct with annotation of lifetimes.
16
+ // ライフタイムのアノテーションつき構造体。
8
17
#[derive(Debug)]
9
18
struct Borrowed<'a> {
10
19
x: &'a i32,
11
20
}
12
21
13
22
// Annotate lifetimes to impl.
23
+ // ライフタイムのアノテーションつきimpl。
14
24
impl<'a> Default for Borrowed<'a> {
15
25
fn default() -> Self {
16
26
Self {
@@ -30,7 +40,10 @@ fn main() {
30
40
-->
31
41
### 参照
32
42
43
+ <!--
33
44
[`trait`s][trait]
45
+ -->
46
+ [ トレイト] [ trait ]
34
47
35
48
36
49
[ trait ] : ../../trait.md
You can’t perform that action at this time.
0 commit comments