Dereferencing
Dereferencing is the operation of following a pointer or reference to access the object or value it designates.
Refactoring to Rust
A pointer dereference is an operation that accesses the value stored at the memory address represented by a pointer.
- How it is used
- Uses dereferencing to read buffers and pass output values between Rust and C.
- How deep it goes
- Explains address lookup and raw-pointer safety, then demonstrates pointer arithmetic, null checks, reads, and writes.
- Examples
- Demonstrates reading a byte vector through an offset pointer and writing a fixed result to a C calculator’s output parameter.
- What you can do after
- Apply it in Rust using unsafe blocks to read a buffer or write through a C-compatible output pointer.
Rust in Action: Systems programming concepts and techniques
Dereferencing is the operation of accessing the value designated by a pointer or reference.
- How it is used
- Uses dereferencing to retrieve values through references, then to expose unsafe raw-pointer memory access.
- How deep it goes
- Explains address-based references and unary syntax, then demonstrates NULL-pointer and segmentation-fault failures.
- Examples
- Uses a large-array reference, an integer-array search, raw memory scans, and printed variable addresses.
- What you can do after
- Apply it via Rust syntax to read values through references and diagnose why invalid raw-pointer dereferences crash.
Read how Rust in Action: Systems programming concepts and techniques explains dereferencing →
Building User-Friendly DSLs
Obtaining the target object of a relation by following a direct object reference.
- How it is used
- Uses direct references to navigate relationships between AST objects during normal interactions.
- How deep it goes
- Defines direct dereferencing and contrasts it with ID resolution, deferring actual IDs until JSON serialization.
- Examples
- Demonstrates an attribute reference from rentalPriceAfterDiscountInitialValue to rentalPriceBeforeDiscountAttribute.
- What you can do after
- Apply it via JavaScript object references to obtain related AST objects without performing ID lookups.
Read how Building User-Friendly DSLs explains dereferencing →
Also covered in
- Go in Action, Second Edition
- Kafka Streams in Action, Second Edition
- Embedded Software with RustIn early access (MEAP)
- Learn Rust in a Month of Lunches
What to know first
- memory locationA memory location is an addressable unit or region of computer memory identified for storing or accessing data or instructions.
- referenceA reference is an indirect value, binding, or relationship that identifies or provides access to another object, value, resource, or source.
Related concepts
- dot notationimplemented by · Dot notation uses periods to separate names in qualified or hierarchical references, commonly to access members or nested fields.
- volatile accesscontrasts with · A volatile access is a read or write of a volatile-qualified object that the language requires implementations to preserve as an observable memory operation.
- unsafe blockuses · An unsafe block is a Rust code region that permits operations whose safety requirements the compiler cannot verify and whose correctness requires programmer responsibility.
- mutable referenceuses · A mutable reference is a reference or handle that provides access to a value or storage location that can be modified, subject to the language’s access rules.
Questions about dereferencing
What is dereferencing?
Dereferencing is the operation of following a pointer or reference to access the object or value it designates.
Which Manning books explain dereferencing?
Refactoring to Rust, Rust in Action: Systems programming concepts and techniques and Building User-Friendly DSLs.
What should I know before learning dereferencing?
Manning books that teach dereferencing usually introduce memory location and reference first.
What is the difference between dereferencing and volatile access?
Dereferencing is the operation of following a pointer or reference to access the object or value it designates. A volatile access is a read or write of a volatile-qualified object that the language requires implementations to preserve as an observable memory operation.
What is dereferencing a kind of?
Dereferencing is a kind of unary operator. A unary operator is an operator that applies an operation to exactly one operand and produces a result.
What is dereferencing also called?
Dereferencing is also called dereference operator.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


