liveBook · Manning

Pointer-sized integer

A pointer-sized integer is a signed or unsigned integer type whose width matches the target platform’s pointer size.

How 2 Manning books explain it

Learn Rust in a Month of Lunches

A pointer-sized integer is a Rust signed or unsigned integer whose width matches the computer architecture.

How it is used
Uses `usize` for array indexing and const-generic array lengths; lists `isize` among signed integer types.
How deep it goes
Defines the types within an integer survey and demonstrates `usize` in a struct; does not calculate architecture-specific widths.
Examples
Shows a struct with `const N: usize` and two arrays, then creates instances with lengths three and four.
What you can do after
Apply it via Rust's `usize` to declare a const-generic array length.

Read how Learn Rust in a Month of Lunches explains pointer-sized integer →

Rust in Action: Systems programming concepts and techniques

isize is Rust's signed integer type whose width matches the target platform's pointer size.

How it is used
Uses isize to name a signed, pointer-width integer while explaining memory addresses, address spaces, and virtual memory.
How deep it goes
Defines pointer-sized width and links it to CPU registers, but stops short of detailed isize operations or code examples.
Examples
Compares isize with word-sized memory units, pointer widths, CPU registers, and pointer diagrams.
What you can do after
Evaluate how a Rust integer’s width relates to pointers, memory addresses, and the target machine.

Read how Rust in Action: Systems programming concepts and techniques explains pointer-sized integer →

Related concepts

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.