Primitive Type usize [-] [+]

Operations and constants for pointer-sized unsigned integers (usize type)

This type was recently added to replace uint. The rollout of the new type will gradually take place over the alpha cycle along with the development of clearer conventions around integer types.

Trait Implementations

impl Int for usize

fn zero() -> usize

fn one() -> usize

fn min_value() -> usize

fn max_value() -> usize

fn count_ones(self) -> usize

fn leading_zeros(self) -> usize

fn trailing_zeros(self) -> usize

fn rotate_left(self, n: usize) -> usize

fn rotate_right(self, n: usize) -> usize

fn swap_bytes(self) -> usize

fn checked_add(self, other: usize) -> Option<usize>

fn checked_sub(self, other: usize) -> Option<usize>

fn checked_mul(self, other: usize) -> Option<usize>

fn checked_div(self, v: usize) -> Option<usize>

fn count_zeros(self) -> usize

fn from_be(usize) -> usize

fn from_le(usize) -> usize

fn to_be(self) -> usize

fn to_le(self) -> usize

fn saturating_add(self, usize) -> usize

fn saturating_sub(self, usize) -> usize

fn pow(self, usize) -> usize

impl UnsignedInt for usize

fn is_power_of_two(self) -> bool

fn next_power_of_two(self) -> usize

fn checked_next_power_of_two(self) -> Option<usize>

impl ToPrimitive for usize

fn to_int(&self) -> Option<isize>

fn to_i8(&self) -> Option<i8>

fn to_i16(&self) -> Option<i16>

fn to_i32(&self) -> Option<i32>

fn to_i64(&self) -> Option<i64>

fn to_uint(&self) -> Option<usize>

fn to_u8(&self) -> Option<u8>

fn to_u16(&self) -> Option<u16>

fn to_u32(&self) -> Option<u32>

fn to_u64(&self) -> Option<u64>

fn to_f32(&self) -> Option<f32>

fn to_f64(&self) -> Option<f64>

fn to_int(&self) -> Option<isize>

fn to_i8(&self) -> Option<i8>

fn to_i16(&self) -> Option<i16>

fn to_i32(&self) -> Option<i32>

fn to_uint(&self) -> Option<usize>

fn to_u8(&self) -> Option<u8>

fn to_u16(&self) -> Option<u16>

fn to_u32(&self) -> Option<u32>

fn to_f32(&self) -> Option<f32>

fn to_f64(&self) -> Option<f64>

impl FromPrimitive for usize

fn from_int(n: isize) -> Option<usize>

fn from_i8(n: i8) -> Option<usize>

fn from_i16(n: i16) -> Option<usize>

fn from_i32(n: i32) -> Option<usize>

fn from_i64(n: i64) -> Option<usize>

fn from_uint(n: usize) -> Option<usize>

fn from_u8(n: u8) -> Option<usize>

fn from_u16(n: u16) -> Option<usize>

fn from_u32(n: u32) -> Option<usize>

fn from_u64(n: u64) -> Option<usize>

fn from_f32(n: f32) -> Option<usize>

fn from_f64(n: f64) -> Option<usize>

fn from_int(isize) -> Option<usize>

fn from_i8(i8) -> Option<usize>

fn from_i16(i16) -> Option<usize>

fn from_i32(i32) -> Option<usize>

fn from_uint(usize) -> Option<usize>

fn from_u8(u8) -> Option<usize>

fn from_u16(u16) -> Option<usize>

fn from_u32(u32) -> Option<usize>

fn from_f32(f32) -> Option<usize>

fn from_f64(f64) -> Option<usize>

impl NumCast for usize

fn from<N>(n: N) -> Option<usize> where N: ToPrimitive

impl FromStr for usize

type Err = ParseIntError

fn from_str(src: &str) -> Result<usize, ParseIntError>

impl FromStrRadix for usize

type Err = ParseIntError

fn from_str_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>

impl Zeroable for usize

impl Add<usize> for usize

type Output = usize

fn add(self, other: usize) -> usize

impl<'a> Add<usize> for &'a usize

type Output = <usize as Add<usize>>::Output

fn add(self, other: usize) -> <usize as Add<usize>>::Output

impl<'a> Add<&'a usize> for usize

type Output = <usize as Add<usize>>::Output

fn add(self, other: &'a usize) -> <usize as Add<usize>>::Output

impl<'a, 'b> Add<&'a usize> for &'b usize

type Output = <usize as Add<usize>>::Output

fn add(self, other: &'a usize) -> <usize as Add<usize>>::Output

impl Sub<usize> for usize

type Output = usize

fn sub(self, other: usize) -> usize

impl<'a> Sub<usize> for &'a usize

type Output = <usize as Sub<usize>>::Output

fn sub(self, other: usize) -> <usize as Sub<usize>>::Output

impl<'a> Sub<&'a usize> for usize

type Output = <usize as Sub<usize>>::Output

fn sub(self, other: &'a usize) -> <usize as Sub<usize>>::Output

impl<'a, 'b> Sub<&'a usize> for &'b usize

type Output = <usize as Sub<usize>>::Output

fn sub(self, other: &'a usize) -> <usize as Sub<usize>>::Output

impl Mul<usize> for usize

type Output = usize

fn mul(self, other: usize) -> usize

impl<'a> Mul<usize> for &'a usize

type Output = <usize as Mul<usize>>::Output

fn mul(self, other: usize) -> <usize as Mul<usize>>::Output

impl<'a> Mul<&'a usize> for usize

type Output = <usize as Mul<usize>>::Output

fn mul(self, other: &'a usize) -> <usize as Mul<usize>>::Output

impl<'a, 'b> Mul<&'a usize> for &'b usize

type Output = <usize as Mul<usize>>::Output

fn mul(self, other: &'a usize) -> <usize as Mul<usize>>::Output

impl Div<usize> for usize

type Output = usize

fn div(self, other: usize) -> usize

impl<'a> Div<usize> for &'a usize

type Output = <usize as Div<usize>>::Output

fn div(self, other: usize) -> <usize as Div<usize>>::Output

impl<'a> Div<&'a usize> for usize

type Output = <usize as Div<usize>>::Output

fn div(self, other: &'a usize) -> <usize as Div<usize>>::Output

impl<'a, 'b> Div<&'a usize> for &'b usize

type Output = <usize as Div<usize>>::Output

fn div(self, other: &'a usize) -> <usize as Div<usize>>::Output

impl Rem<usize> for usize

type Output = usize

fn rem(self, other: usize) -> usize

impl<'a> Rem<usize> for &'a usize

type Output = <usize as Rem<usize>>::Output

fn rem(self, other: usize) -> <usize as Rem<usize>>::Output

impl<'a> Rem<&'a usize> for usize

type Output = <usize as Rem<usize>>::Output

fn rem(self, other: &'a usize) -> <usize as Rem<usize>>::Output

impl<'a, 'b> Rem<&'a usize> for &'b usize

type Output = <usize as Rem<usize>>::Output

fn rem(self, other: &'a usize) -> <usize as Rem<usize>>::Output

impl Neg for usize

type Output = usize

fn neg(self) -> usize

impl<'a> Neg for &'a usize

type Output = <usize as Neg>::Output

fn neg(self) -> <usize as Neg>::Output

impl Not for usize

type Output = usize

fn not(self) -> usize

impl<'a> Not for &'a usize

type Output = <usize as Not>::Output

fn not(self) -> <usize as Not>::Output

impl BitAnd<usize> for usize

type Output = usize

fn bitand(self, rhs: usize) -> usize

impl<'a> BitAnd<usize> for &'a usize

type Output = <usize as BitAnd<usize>>::Output

fn bitand(self, other: usize) -> <usize as BitAnd<usize>>::Output

impl<'a> BitAnd<&'a usize> for usize

type Output = <usize as BitAnd<usize>>::Output

fn bitand(self, other: &'a usize) -> <usize as BitAnd<usize>>::Output

impl<'a, 'b> BitAnd<&'a usize> for &'b usize

type Output = <usize as BitAnd<usize>>::Output

fn bitand(self, other: &'a usize) -> <usize as BitAnd<usize>>::Output

impl BitOr<usize> for usize

type Output = usize

fn bitor(self, rhs: usize) -> usize

impl<'a> BitOr<usize> for &'a usize

type Output = <usize as BitOr<usize>>::Output

fn bitor(self, other: usize) -> <usize as BitOr<usize>>::Output

impl<'a> BitOr<&'a usize> for usize

type Output = <usize as BitOr<usize>>::Output

fn bitor(self, other: &'a usize) -> <usize as BitOr<usize>>::Output

impl<'a, 'b> BitOr<&'a usize> for &'b usize

type Output = <usize as BitOr<usize>>::Output

fn bitor(self, other: &'a usize) -> <usize as BitOr<usize>>::Output

impl BitXor<usize> for usize

type Output = usize

fn bitxor(self, other: usize) -> usize

impl<'a> BitXor<usize> for &'a usize

type Output = <usize as BitXor<usize>>::Output

fn bitxor(self, other: usize) -> <usize as BitXor<usize>>::Output

impl<'a> BitXor<&'a usize> for usize

type Output = <usize as BitXor<usize>>::Output

fn bitxor(self, other: &'a usize) -> <usize as BitXor<usize>>::Output

impl<'a, 'b> BitXor<&'a usize> for &'b usize

type Output = <usize as BitXor<usize>>::Output

fn bitxor(self, other: &'a usize) -> <usize as BitXor<usize>>::Output

impl Shl<u8> for usize

type Output = usize

fn shl(self, other: u8) -> usize

impl<'a> Shl<u8> for &'a usize

type Output = <usize as Shl<u8>>::Output

fn shl(self, other: u8) -> <usize as Shl<u8>>::Output

impl<'a> Shl<&'a u8> for usize

type Output = <usize as Shl<u8>>::Output

fn shl(self, other: &'a u8) -> <usize as Shl<u8>>::Output

impl<'a, 'b> Shl<&'a u8> for &'b usize

type Output = <usize as Shl<u8>>::Output

fn shl(self, other: &'a u8) -> <usize as Shl<u8>>::Output

impl Shl<u16> for usize

type Output = usize

fn shl(self, other: u16) -> usize

impl<'a> Shl<u16> for &'a usize

type Output = <usize as Shl<u16>>::Output

fn shl(self, other: u16) -> <usize as Shl<u16>>::Output

impl<'a> Shl<&'a u16> for usize

type Output = <usize as Shl<u16>>::Output

fn shl(self, other: &'a u16) -> <usize as Shl<u16>>::Output

impl<'a, 'b> Shl<&'a u16> for &'b usize

type Output = <usize as Shl<u16>>::Output

fn shl(self, other: &'a u16) -> <usize as Shl<u16>>::Output

impl Shl<u32> for usize

type Output = usize

fn shl(self, other: u32) -> usize

impl<'a> Shl<u32> for &'a usize

type Output = <usize as Shl<u32>>::Output

fn shl(self, other: u32) -> <usize as Shl<u32>>::Output

impl<'a> Shl<&'a u32> for usize

type Output = <usize as Shl<u32>>::Output

fn shl(self, other: &'a u32) -> <usize as Shl<u32>>::Output

impl<'a, 'b> Shl<&'a u32> for &'b usize

type Output = <usize as Shl<u32>>::Output

fn shl(self, other: &'a u32) -> <usize as Shl<u32>>::Output

impl Shl<u64> for usize

type Output = usize

fn shl(self, other: u64) -> usize

impl<'a> Shl<u64> for &'a usize

type Output = <usize as Shl<u64>>::Output

fn shl(self, other: u64) -> <usize as Shl<u64>>::Output

impl<'a> Shl<&'a u64> for usize

type Output = <usize as Shl<u64>>::Output

fn shl(self, other: &'a u64) -> <usize as Shl<u64>>::Output

impl<'a, 'b> Shl<&'a u64> for &'b usize

type Output = <usize as Shl<u64>>::Output

fn shl(self, other: &'a u64) -> <usize as Shl<u64>>::Output

impl Shl<usize> for usize

type Output = usize

fn shl(self, other: usize) -> usize

impl<'a> Shl<usize> for &'a usize

type Output = <usize as Shl<usize>>::Output

fn shl(self, other: usize) -> <usize as Shl<usize>>::Output

impl<'a> Shl<&'a usize> for usize

type Output = <usize as Shl<usize>>::Output

fn shl(self, other: &'a usize) -> <usize as Shl<usize>>::Output

impl<'a, 'b> Shl<&'a usize> for &'b usize

type Output = <usize as Shl<usize>>::Output

fn shl(self, other: &'a usize) -> <usize as Shl<usize>>::Output

impl Shl<i8> for usize

type Output = usize

fn shl(self, other: i8) -> usize

impl<'a> Shl<i8> for &'a usize

type Output = <usize as Shl<i8>>::Output

fn shl(self, other: i8) -> <usize as Shl<i8>>::Output

impl<'a> Shl<&'a i8> for usize

type Output = <usize as Shl<i8>>::Output

fn shl(self, other: &'a i8) -> <usize as Shl<i8>>::Output

impl<'a, 'b> Shl<&'a i8> for &'b usize

type Output = <usize as Shl<i8>>::Output

fn shl(self, other: &'a i8) -> <usize as Shl<i8>>::Output

impl Shl<i16> for usize

type Output = usize

fn shl(self, other: i16) -> usize

impl<'a> Shl<i16> for &'a usize

type Output = <usize as Shl<i16>>::Output

fn shl(self, other: i16) -> <usize as Shl<i16>>::Output

impl<'a> Shl<&'a i16> for usize

type Output = <usize as Shl<i16>>::Output

fn shl(self, other: &'a i16) -> <usize as Shl<i16>>::Output

impl<'a, 'b> Shl<&'a i16> for &'b usize

type Output = <usize as Shl<i16>>::Output

fn shl(self, other: &'a i16) -> <usize as Shl<i16>>::Output

impl Shl<i32> for usize

type Output = usize

fn shl(self, other: i32) -> usize

impl<'a> Shl<i32> for &'a usize

type Output = <usize as Shl<i32>>::Output

fn shl(self, other: i32) -> <usize as Shl<i32>>::Output

impl<'a> Shl<&'a i32> for usize

type Output = <usize as Shl<i32>>::Output

fn shl(self, other: &'a i32) -> <usize as Shl<i32>>::Output

impl<'a, 'b> Shl<&'a i32> for &'b usize

type Output = <usize as Shl<i32>>::Output

fn shl(self, other: &'a i32) -> <usize as Shl<i32>>::Output

impl Shl<i64> for usize

type Output = usize

fn shl(self, other: i64) -> usize

impl<'a> Shl<i64> for &'a usize

type Output = <usize as Shl<i64>>::Output

fn shl(self, other: i64) -> <usize as Shl<i64>>::Output

impl<'a> Shl<&'a i64> for usize

type Output = <usize as Shl<i64>>::Output

fn shl(self, other: &'a i64) -> <usize as Shl<i64>>::Output

impl<'a, 'b> Shl<&'a i64> for &'b usize

type Output = <usize as Shl<i64>>::Output

fn shl(self, other: &'a i64) -> <usize as Shl<i64>>::Output

impl Shl<isize> for usize

type Output = usize

fn shl(self, other: isize) -> usize

impl<'a> Shl<isize> for &'a usize

type Output = <usize as Shl<isize>>::Output

fn shl(self, other: isize) -> <usize as Shl<isize>>::Output

impl<'a> Shl<&'a isize> for usize

type Output = <usize as Shl<isize>>::Output

fn shl(self, other: &'a isize) -> <usize as Shl<isize>>::Output

impl<'a, 'b> Shl<&'a isize> for &'b usize

type Output = <usize as Shl<isize>>::Output

fn shl(self, other: &'a isize) -> <usize as Shl<isize>>::Output

impl Shr<u8> for usize

type Output = usize

fn shr(self, other: u8) -> usize

impl<'a> Shr<u8> for &'a usize

type Output = <usize as Shr<u8>>::Output

fn shr(self, other: u8) -> <usize as Shr<u8>>::Output

impl<'a> Shr<&'a u8> for usize

type Output = <usize as Shr<u8>>::Output

fn shr(self, other: &'a u8) -> <usize as Shr<u8>>::Output

impl<'a, 'b> Shr<&'a u8> for &'b usize

type Output = <usize as Shr<u8>>::Output

fn shr(self, other: &'a u8) -> <usize as Shr<u8>>::Output

impl Shr<u16> for usize

type Output = usize

fn shr(self, other: u16) -> usize

impl<'a> Shr<u16> for &'a usize

type Output = <usize as Shr<u16>>::Output

fn shr(self, other: u16) -> <usize as Shr<u16>>::Output

impl<'a> Shr<&'a u16> for usize

type Output = <usize as Shr<u16>>::Output

fn shr(self, other: &'a u16) -> <usize as Shr<u16>>::Output

impl<'a, 'b> Shr<&'a u16> for &'b usize

type Output = <usize as Shr<u16>>::Output

fn shr(self, other: &'a u16) -> <usize as Shr<u16>>::Output

impl Shr<u32> for usize

type Output = usize

fn shr(self, other: u32) -> usize

impl<'a> Shr<u32> for &'a usize

type Output = <usize as Shr<u32>>::Output

fn shr(self, other: u32) -> <usize as Shr<u32>>::Output

impl<'a> Shr<&'a u32> for usize

type Output = <usize as Shr<u32>>::Output

fn shr(self, other: &'a u32) -> <usize as Shr<u32>>::Output

impl<'a, 'b> Shr<&'a u32> for &'b usize

type Output = <usize as Shr<u32>>::Output

fn shr(self, other: &'a u32) -> <usize as Shr<u32>>::Output

impl Shr<u64> for usize

type Output = usize

fn shr(self, other: u64) -> usize

impl<'a> Shr<u64> for &'a usize

type Output = <usize as Shr<u64>>::Output

fn shr(self, other: u64) -> <usize as Shr<u64>>::Output

impl<'a> Shr<&'a u64> for usize

type Output = <usize as Shr<u64>>::Output

fn shr(self, other: &'a u64) -> <usize as Shr<u64>>::Output

impl<'a, 'b> Shr<&'a u64> for &'b usize

type Output = <usize as Shr<u64>>::Output

fn shr(self, other: &'a u64) -> <usize as Shr<u64>>::Output

impl Shr<usize> for usize

type Output = usize

fn shr(self, other: usize) -> usize

impl<'a> Shr<usize> for &'a usize

type Output = <usize as Shr<usize>>::Output

fn shr(self, other: usize) -> <usize as Shr<usize>>::Output

impl<'a> Shr<&'a usize> for usize

type Output = <usize as Shr<usize>>::Output

fn shr(self, other: &'a usize) -> <usize as Shr<usize>>::Output

impl<'a, 'b> Shr<&'a usize> for &'b usize

type Output = <usize as Shr<usize>>::Output

fn shr(self, other: &'a usize) -> <usize as Shr<usize>>::Output

impl Shr<i8> for usize

type Output = usize

fn shr(self, other: i8) -> usize

impl<'a> Shr<i8> for &'a usize

type Output = <usize as Shr<i8>>::Output

fn shr(self, other: i8) -> <usize as Shr<i8>>::Output

impl<'a> Shr<&'a i8> for usize

type Output = <usize as Shr<i8>>::Output

fn shr(self, other: &'a i8) -> <usize as Shr<i8>>::Output

impl<'a, 'b> Shr<&'a i8> for &'b usize

type Output = <usize as Shr<i8>>::Output

fn shr(self, other: &'a i8) -> <usize as Shr<i8>>::Output

impl Shr<i16> for usize

type Output = usize

fn shr(self, other: i16) -> usize

impl<'a> Shr<i16> for &'a usize

type Output = <usize as Shr<i16>>::Output

fn shr(self, other: i16) -> <usize as Shr<i16>>::Output

impl<'a> Shr<&'a i16> for usize

type Output = <usize as Shr<i16>>::Output

fn shr(self, other: &'a i16) -> <usize as Shr<i16>>::Output

impl<'a, 'b> Shr<&'a i16> for &'b usize

type Output = <usize as Shr<i16>>::Output

fn shr(self, other: &'a i16) -> <usize as Shr<i16>>::Output

impl Shr<i32> for usize

type Output = usize

fn shr(self, other: i32) -> usize

impl<'a> Shr<i32> for &'a usize

type Output = <usize as Shr<i32>>::Output

fn shr(self, other: i32) -> <usize as Shr<i32>>::Output

impl<'a> Shr<&'a i32> for usize

type Output = <usize as Shr<i32>>::Output

fn shr(self, other: &'a i32) -> <usize as Shr<i32>>::Output

impl<'a, 'b> Shr<&'a i32> for &'b usize

type Output = <usize as Shr<i32>>::Output

fn shr(self, other: &'a i32) -> <usize as Shr<i32>>::Output

impl Shr<i64> for usize

type Output = usize

fn shr(self, other: i64) -> usize

impl<'a> Shr<i64> for &'a usize

type Output = <usize as Shr<i64>>::Output

fn shr(self, other: i64) -> <usize as Shr<i64>>::Output

impl<'a> Shr<&'a i64> for usize

type Output = <usize as Shr<i64>>::Output

fn shr(self, other: &'a i64) -> <usize as Shr<i64>>::Output

impl<'a, 'b> Shr<&'a i64> for &'b usize

type Output = <usize as Shr<i64>>::Output

fn shr(self, other: &'a i64) -> <usize as Shr<i64>>::Output

impl Shr<isize> for usize

type Output = usize

fn shr(self, other: isize) -> usize

impl<'a> Shr<isize> for &'a usize

type Output = <usize as Shr<isize>>::Output

fn shr(self, other: isize) -> <usize as Shr<isize>>::Output

impl<'a> Shr<&'a isize> for usize

type Output = <usize as Shr<isize>>::Output

fn shr(self, other: &'a isize) -> <usize as Shr<isize>>::Output

impl<'a, 'b> Shr<&'a isize> for &'b usize

type Output = <usize as Shr<isize>>::Output

fn shr(self, other: &'a isize) -> <usize as Shr<isize>>::Output

impl PartialEq<usize> for usize

fn eq(&self, other: &usize) -> bool

fn ne(&self, other: &usize) -> bool

fn ne(&self, &usize) -> bool

impl Eq for usize

fn assert_receiver_is_total_eq(&self)

impl PartialOrd<usize> for usize

fn partial_cmp(&self, other: &usize) -> Option<Ordering>

fn lt(&self, other: &usize) -> bool

fn le(&self, other: &usize) -> bool

fn ge(&self, other: &usize) -> bool

fn gt(&self, other: &usize) -> bool

fn lt(&self, &usize) -> bool

fn le(&self, &usize) -> bool

fn gt(&self, &usize) -> bool

fn ge(&self, &usize) -> bool

impl Ord for usize

fn cmp(&self, other: &usize) -> Ordering

impl Clone for usize

fn clone(&self) -> usize

Return a deep copy of the value.

fn clone_from(&mut self, &usize)

impl Default for usize

fn default() -> usize

impl Hash for usize

fn hash<H>(&self, state: &mut H) where H: Hasher

fn hash_slice<H>(data: &[usize], state: &mut H) where H: Hasher

fn hash_slice<H>(&[usize], &mut H) where H: Hasher, usize: Sized

impl Display for usize

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

impl Binary for usize

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

impl Octal for usize

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

impl LowerHex for usize

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

impl UpperHex for usize

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

impl Debug for usize

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

impl SampleRange for usize

fn construct_range(low: usize, high: usize) -> Range<usize>

fn sample_range<R>(r: &Range<usize>, rng: &mut R) -> usize where R: Rng

impl Rand for usize

fn rand<R>(rng: &mut R) -> usize where R: Rng