Binary representation writes numbers using just two digits: 0 and 1. Each position is a bit. Unlike decimal positions, which increase by factors of ten, binary positions increase by factors of two. section 1.3
Read a bit pattern from right to left: its positions are worth 1, 2, 4, 8, and so on. A 1 includes that position’s value; a 0 leaves it out. Add the included values to find the number. section 1.3
Why a u8 stops at 255
A u8 has eight bits. With every bit set to 1, its pattern is 11111111, worth 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 255. A u16 has eight additional bits, so it can hold values up to 65,535. More bits mean room for larger numbers. section 1.3
This gives you a practical way to think about Rust integer types: the number in a type name such as u8 or u16 tells you how many bits it has. Use that bit count to judge whether the type can hold the numbers you need. section 1.3 section 1.12





