mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-02-02 23:38:41 +08:00
Forward reference to enum and trait object chapters
This commit is contained in:
parent
a929b91341
commit
4eb3b6271c
@ -4,9 +4,9 @@
|
|||||||
their name, they can take arguments and return values, and they contain some
|
their name, they can take arguments and return values, and they contain some
|
||||||
code that gets run when they're called from somewhere else. Methods are
|
code that gets run when they're called from somewhere else. Methods are
|
||||||
different from functions, however, because they're defined within the context
|
different from functions, however, because they're defined within the context
|
||||||
of a struct (or an enum or a trait object, but we're going to focus on structs
|
of a struct (or an enum or a trait object, which we will cover in Chapters 6
|
||||||
in this chapter), and their first argument is always `self`, which represents
|
and XX respectively), and their first argument is always `self`, which
|
||||||
the instance of the struct that the method is being called on.
|
represents the instance of the struct that the method is being called on.
|
||||||
|
|
||||||
### Defining Methods
|
### Defining Methods
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user