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(x: Self) -> Self

fn from_le(x: Self) -> Self

fn to_be(self) -> Self

fn to_le(self) -> Self

fn saturating_add(self, other: Self) -> Self

fn saturating_sub(self, other: Self) -> Self

fn pow(self, exp: usize) -> Self

impl UnsignedInt for usize

fn is_power_of_two(self) -> bool

fn next_power_of_two(self) -> Self

fn checked_next_power_of_two(self) -> Option<Self>

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>

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>

impl NumCast for usize

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

impl FromStr for usize

fn from_str(src: &str) -> Option<usize>

impl FromStrRadix for usize

fn from_str_radix(src: &str, radix: usize) -> Option<usize>

impl Zeroable for usize

impl Add for usize

type Output = usize

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

impl Sub for usize

type Output = usize

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

impl Mul for usize

type Output = usize

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

impl Div for usize

type Output = usize

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

impl Rem for usize

type Output = usize

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

impl Neg for usize

type Output = usize

fn neg(self) -> usize

impl Not for usize

type Output = usize

fn not(self) -> usize

impl BitAnd for usize

type Output = usize

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

impl BitOr for usize

type Output = usize

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

impl BitXor for usize

type Output = usize

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

impl Shl<usize> for usize

type Output = usize

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

impl Shr<usize> for usize

type Output = usize

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

impl PartialEq for usize

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

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

impl Eq for usize

impl PartialOrd 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

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, source: &Self)

impl Default for usize

fn default() -> usize

impl Step for usize

fn step(&mut self)

fn step_back(&mut self)

fn steps_between(start: &usize, end: &usize) -> Option<usize>

impl<S: Writer + Hasher> Hash<S> for usize

fn hash(&self, state: &mut S)

impl String for usize

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

impl Binary for usize

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

impl Octal for usize

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

impl LowerHex for usize

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

impl UpperHex for usize

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

impl Show for usize

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