Skip to Content
The Rust Programming Language (Covers Rust 2018)
book

The Rust Programming Language (Covers Rust 2018)

by Carol Nichols
July 2019
Intermediate to advanced
560 pages
14h 12m
English
No Starch Press
Content preview from The Rust Programming Language (Covers Rust 2018)

15SMART POINTERS

Image

A pointer is a general concept for a variable that contains an address in memory. This address refers to, or “points at,” some other data. The most common kind of pointer in Rust is a reference, which you learned about in Chapter 4. References are indicated by the & symbol and borrow the value they point to. They don’t have any special capabilities other than referring to data. Also, they don’t have any overhead and are the kind of pointer we use most often.

Smart pointers, on the other hand, are data structures that not only act like a pointer but also have additional metadata and capabilities. The concept of smart pointers isn’t ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Rust Programming Language

The Rust Programming Language

Steve Klabnik, Carol Nichols
Hands-on Rust

Hands-on Rust

Herbert Wolverson
Rust Web Programming

Rust Web Programming

Maxwell Flitton

Publisher Resources

ISBN: 9781098122539