0 votes
in Rust by
Explain the rule of using &self, self and &mut self in the declaration method?

1 Answer

0 votes
by
  1. &self : when Read-only reference is required to the function.
  2. self : When a value is to be consumed by the function.
  3. &mut : When a value needs to be mutated by the function with consuming it.
...