What kind of a type is usize? I see it is used a lot for ranges, but I do not understand what it stands for. Unsigned size I guess, but what does that mean? Why not just use some appropriate u-int type like u8 or u64? Is it trying to convey the idea that the int is limitless? If so, how do you actually implement “limitless” for an int?
usize is the the natural unsized integer for the platform. (Can’t think of the right word). That means on 64 bit computers its a u64 and in 32bit it’s a u32.
To follow up on why this is important/useful, Pointing out that it’s the pointer size (sorry, not sorry, for the pun), is helpful. Usize allows you to point to whatever memory you can hold on the machine in question. Having that as a specific type allows portability between the two architectures.