liveBook · Manning

Const variable

As explained in Rust in Action: Systems programming concepts and techniques

A const declaration defines a compile-time constant whose value cannot be changed.

A `const` marks a value that never changes. It is mentioned alongside `static mut`, which declares mutable global state used to hold error information. section 3.4.1

How Rust in Action: Systems programming concepts and techniques covers it

How deep it goes
Mentions const for values that never change but gives no const declaration example or deeper explanation.
Examples
Contrasts const with a mutable global ERROR variable used to propagate error information.
What you can do after
Understand that const denotes a value that never changes.
How it connects
Connects const with Rust global variables, mutable static state, and error handling.

Also explained in

Compare how 8 books explain const variable →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust in Action: Systems programming concepts and techniques. The section links point to the parts of the book it draws on.