AI Features

Borrowing and Dereferencing Operators

This lesson discusses the borrowing and dereferencing operator in Rust.

Borrowing Operator

Borrowing means to reference the original data binding or to share the data.

References are just like pointers in C.

Two variables are involved in a borrowing relationship when the referenced variable holds a value that the referencing variable borrows. The referencing variable simply points to the memory location of the referenced variable.

svg viewer

The following illustration shows ...

Ask