By clear receiver it means there is only one function a name can point to. For instance you cannot have:
struct Foo;
impl Foo {
pub fn foo(self) {}
pub fn foo(&self) {}
}
error[E0592]: duplicate definitions with name `foo`
--> src/lib.rs:5:5
|
4 | pub fn foo(self) {}
| ---------------- other definition for `foo`
5 | pub fn foo(&self) {}
| ^^^^^^^^^^^^^^^^^ duplicate definitions for `foo`
Which means it is easy to see what the function requires when you call it. It will either have self
or &self
and when it is &self
it can auto reference the value for you. This is unlike C and C++ where you can overload a function definition with multiple different signatures and bodies and thus the signature is important to know to know which function to actually call.
Yes rust has a operator for dereferencing as well (the *
). This can be used to copy a value out of a reference for simple types the implement Copy at least.