You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-07-13 17:44:20 +02:00
Merge pull request #75 from google/method-receiver-types
Mention that there are other receiver types
This commit is contained in:
@ -13,3 +13,7 @@ are other possible receivers for a method:
|
|||||||
transmitted.
|
transmitted.
|
||||||
* No receiver: this becomes a static method on the struct. Typically used to
|
* No receiver: this becomes a static method on the struct. Typically used to
|
||||||
create constructors which are called `new` by convention.
|
create constructors which are called `new` by convention.
|
||||||
|
|
||||||
|
Beyond variants on `self`, there are also
|
||||||
|
[special wrapper types](https://doc.rust-lang.org/reference/special-types-and-traits.html)
|
||||||
|
allowed to be receiver types, such as `Box<Self>`.
|
||||||
|
Reference in New Issue
Block a user