Skip to content

Glossary: Rust Basics

self / Self

Also written: self, Self, &self, &mut self

`self` is the first parameter of a method, the instance it was called on; `&self` reads it, `&mut self` changes it, and plain `self` takes ownership. `Self` is short for the type the `impl` is for.

Where the book teaches it

Related terms

MethodimplAssociated function