liveBook · Manning

Pointer-sized integer

Also called usize, isize

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
Introduces isize and usize as integer types and uses usize for array indexing and generic array lengths.
How deep it goes
Defines signedness and explains bits and binary, then illustrates usize in a const-generic declaration without detailing pointer representation.
Examples
Uses fixed-width integer ranges and a generic struct containing two arrays with a shared usize length.
What you can do after
Understand the distinction between isize and usize and recognize usize in an array-length declaration.

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 →

Also covered in

What to know first

Related concepts

Questions about pointer-sized integer

What is pointer-sized integer?

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

Which Manning books explain pointer-sized integer?

Learn Rust in a Month of Lunches and Rust in Action: Systems programming concepts and techniques.

What should I know before learning pointer-sized integer?

Manning books that teach pointer-sized integer usually introduce option first.

What is the difference between pointer-sized integer and unsigned integer?

A pointer-sized integer is a signed or unsigned integer type whose width matches the target platform’s pointer size. An unsigned integer is an integer type or representation whose values are nonnegative.

What is pointer-sized integer part of?

Pointer-sized integer is part of slicing. Slicing selects or partitions a portion of an indexed sequence or multidimensional array, often along specified indices or dimensions.

What is pointer-sized integer also called?

Pointer-sized integer is also called usize or isize.

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.