Primitive Typei32
Expand description
The 32-bit signed integer type.
Implementations§
Source§impli32
impli32
1.43.0 ·Sourcepub constMIN:i32 = -2_147_483_648i32
pub constMIN:i32 = -2_147_483_648i32
The smallest value that can be represented by this integer type(−231).
§Examples
1.43.0 ·Sourcepub constMAX:i32 = 2_147_483_647i32
pub constMAX:i32 = 2_147_483_647i32
The largest value that can be represented by this integer type(231 − 1).
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fncount_ones(self) ->u32
pub const fncount_ones(self) ->u32
Returns the number of ones in the binary representation ofself.
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fncount_zeros(self) ->u32
pub const fncount_zeros(self) ->u32
Returns the number of zeros in the binary representation ofself.
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnleading_zeros(self) ->u32
pub const fnleading_zeros(self) ->u32
1.0.0 (const: 1.32.0) ·Sourcepub const fntrailing_zeros(self) ->u32
pub const fntrailing_zeros(self) ->u32
Returns the number of trailing zeros in the binary representation ofself.
§Examples
1.46.0 (const: 1.46.0) ·Sourcepub const fnleading_ones(self) ->u32
pub const fnleading_ones(self) ->u32
Returns the number of leading ones in the binary representation ofself.
§Examples
1.46.0 (const: 1.46.0) ·Sourcepub const fntrailing_ones(self) ->u32
pub const fntrailing_ones(self) ->u32
Returns the number of trailing ones in the binary representation ofself.
§Examples
Sourcepub const fnisolate_highest_one(self) ->i32
🔬This is a nightly-only experimental API. (isolate_most_least_significant_one #136909)
pub const fnisolate_highest_one(self) ->i32
isolate_most_least_significant_one #136909)Returnsself with only the most significant bit set, or0 ifthe input is0.
§Examples
Sourcepub const fnisolate_lowest_one(self) ->i32
🔬This is a nightly-only experimental API. (isolate_most_least_significant_one #136909)
pub const fnisolate_lowest_one(self) ->i32
isolate_most_least_significant_one #136909)Returnsself with only the least significant bit set, or0 ifthe input is0.
§Examples
Sourcepub const fnhighest_one(self) ->Option<u32>
🔬This is a nightly-only experimental API. (int_lowest_highest_one #145203)
pub const fnhighest_one(self) ->Option<u32>
int_lowest_highest_one #145203)Returns the index of the highest bit set to one inself, orNoneifself is0.
§Examples
Sourcepub const fnlowest_one(self) ->Option<u32>
🔬This is a nightly-only experimental API. (int_lowest_highest_one #145203)
pub const fnlowest_one(self) ->Option<u32>
int_lowest_highest_one #145203)Returns the index of the lowest bit set to one inself, orNoneifself is0.
§Examples
1.87.0 (const: 1.87.0) ·Sourcepub const fncast_unsigned(self) ->u32
pub const fncast_unsigned(self) ->u32
Returns the bit pattern ofself reinterpreted as an unsigned integer of the same size.
This produces the same result as anas cast, but ensures that the bit-width remainsthe same.
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnrotate_left(self, n:u32) ->i32
pub const fnrotate_left(self, n:u32) ->i32
Shifts the bits to the left by a specified amount,n,wrapping the truncated bits to the end of the resulting integer.
Please note this isn’t the same operation as the<< shifting operator!
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnrotate_right(self, n:u32) ->i32
pub const fnrotate_right(self, n:u32) ->i32
Shifts the bits to the right by a specified amount,n,wrapping the truncated bits to the beginning of the resultinginteger.
Please note this isn’t the same operation as the>> shifting operator!
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnswap_bytes(self) ->i32
pub const fnswap_bytes(self) ->i32
Reverses the byte order of the integer.
§Examples
1.37.0 (const: 1.37.0) ·Sourcepub const fnreverse_bits(self) ->i32
pub const fnreverse_bits(self) ->i32
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit,second least-significant bit becomes second most-significant bit, etc.
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnfrom_be(x:i32) ->i32
pub const fnfrom_be(x:i32) ->i32
Converts an integer from big endian to the target’s endianness.
On big endian this is a no-op. On little endian the bytes are swapped.
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnfrom_le(x:i32) ->i32
pub const fnfrom_le(x:i32) ->i32
Converts an integer from little endian to the target’s endianness.
On little endian this is a no-op. On big endian the bytes are swapped.
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnto_be(self) ->i32
pub const fnto_be(self) ->i32
Convertsself to big endian from the target’s endianness.
On big endian this is a no-op. On little endian the bytes are swapped.
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnto_le(self) ->i32
pub const fnto_le(self) ->i32
Convertsself to little endian from the target’s endianness.
On little endian this is a no-op. On big endian the bytes are swapped.
§Examples
1.0.0 (const: 1.47.0) ·Sourcepub const fnchecked_add(self, rhs:i32) ->Option<i32>
pub const fnchecked_add(self, rhs:i32) ->Option<i32>
Checked integer addition. Computesself + rhs, returningNoneif overflow occurred.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_add(self, rhs:i32) ->i32
pub const fnstrict_add(self, rhs:i32) ->i32
1.79.0 (const: 1.79.0) ·Sourcepub const unsafe fnunchecked_add(self, rhs:i32) ->i32
pub const unsafe fnunchecked_add(self, rhs:i32) ->i32
Unchecked integer addition. Computesself + rhs, assuming overflowcannot occur.
Callingx.unchecked_add(y) is semantically equivalent to callingx.checked_add(y).unwrap_unchecked().
If you’re just trying to avoid the panic in debug mode, thendo notuse this. Instead, you’re looking forwrapping_add.
§Safety
This results in undefined behavior whenself + rhs > i32::MAX orself + rhs < i32::MIN,i.e. whenchecked_add would returnNone.
1.66.0 (const: 1.66.0) ·Sourcepub const fnchecked_add_unsigned(self, rhs:u32) ->Option<i32>
pub const fnchecked_add_unsigned(self, rhs:u32) ->Option<i32>
Checked addition with an unsigned integer. Computesself + rhs,returningNone if overflow occurred.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_add_unsigned(self, rhs:u32) ->i32
pub const fnstrict_add_unsigned(self, rhs:u32) ->i32
1.0.0 (const: 1.47.0) ·Sourcepub const fnchecked_sub(self, rhs:i32) ->Option<i32>
pub const fnchecked_sub(self, rhs:i32) ->Option<i32>
Checked integer subtraction. Computesself - rhs, returningNone ifoverflow occurred.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_sub(self, rhs:i32) ->i32
pub const fnstrict_sub(self, rhs:i32) ->i32
1.79.0 (const: 1.79.0) ·Sourcepub const unsafe fnunchecked_sub(self, rhs:i32) ->i32
pub const unsafe fnunchecked_sub(self, rhs:i32) ->i32
Unchecked integer subtraction. Computesself - rhs, assuming overflowcannot occur.
Callingx.unchecked_sub(y) is semantically equivalent to callingx.checked_sub(y).unwrap_unchecked().
If you’re just trying to avoid the panic in debug mode, thendo notuse this. Instead, you’re looking forwrapping_sub.
§Safety
This results in undefined behavior whenself - rhs > i32::MAX orself - rhs < i32::MIN,i.e. whenchecked_sub would returnNone.
1.66.0 (const: 1.66.0) ·Sourcepub const fnchecked_sub_unsigned(self, rhs:u32) ->Option<i32>
pub const fnchecked_sub_unsigned(self, rhs:u32) ->Option<i32>
Checked subtraction with an unsigned integer. Computesself - rhs,returningNone if overflow occurred.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_sub_unsigned(self, rhs:u32) ->i32
pub const fnstrict_sub_unsigned(self, rhs:u32) ->i32
1.0.0 (const: 1.47.0) ·Sourcepub const fnchecked_mul(self, rhs:i32) ->Option<i32>
pub const fnchecked_mul(self, rhs:i32) ->Option<i32>
Checked integer multiplication. Computesself * rhs, returningNone ifoverflow occurred.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_mul(self, rhs:i32) ->i32
pub const fnstrict_mul(self, rhs:i32) ->i32
1.79.0 (const: 1.79.0) ·Sourcepub const unsafe fnunchecked_mul(self, rhs:i32) ->i32
pub const unsafe fnunchecked_mul(self, rhs:i32) ->i32
Unchecked integer multiplication. Computesself * rhs, assuming overflowcannot occur.
Callingx.unchecked_mul(y) is semantically equivalent to callingx.checked_mul(y).unwrap_unchecked().
If you’re just trying to avoid the panic in debug mode, thendo notuse this. Instead, you’re looking forwrapping_mul.
§Safety
This results in undefined behavior whenself * rhs > i32::MAX orself * rhs < i32::MIN,i.e. whenchecked_mul would returnNone.
1.0.0 (const: 1.52.0) ·Sourcepub const fnchecked_div(self, rhs:i32) ->Option<i32>
pub const fnchecked_div(self, rhs:i32) ->Option<i32>
Checked integer division. Computesself / rhs, returningNone ifrhs == 0or the division results in overflow.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_div(self, rhs:i32) ->i32
pub const fnstrict_div(self, rhs:i32) ->i32
Strict integer division. Computesself / rhs, panickingif overflow occurred.
§Panics
This function will panic ifrhs is zero.
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
The only case where such an overflow can occur is when one dividesMIN / -1 on a signed type (whereMIN is the negative minimal value for the type); this is equivalent to-MIN, a positive valuethat is too large to represent in the type.
§Examples
The following panics because of overflow:
The following panics because of division by zero:
1.38.0 (const: 1.52.0) ·Sourcepub const fnchecked_div_euclid(self, rhs:i32) ->Option<i32>
pub const fnchecked_div_euclid(self, rhs:i32) ->Option<i32>
Checked Euclidean division. Computesself.div_euclid(rhs),returningNone ifrhs == 0 or the division results in overflow.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_div_euclid(self, rhs:i32) ->i32
pub const fnstrict_div_euclid(self, rhs:i32) ->i32
Strict Euclidean division. Computesself.div_euclid(rhs), panickingif overflow occurred.
§Panics
This function will panic ifrhs is zero.
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
The only case where such an overflow can occur is when one dividesMIN / -1 on a signed type (whereMIN is the negative minimal value for the type); this is equivalent to-MIN, a positive valuethat is too large to represent in the type.
§Examples
The following panics because of overflow:
The following panics because of division by zero:
Sourcepub const fnchecked_exact_div(self, rhs:i32) ->Option<i32>
🔬This is a nightly-only experimental API. (exact_div #139911)
pub const fnchecked_exact_div(self, rhs:i32) ->Option<i32>
exact_div #139911)Checked integer division without remainder. Computesself / rhs,returningNone ifrhs == 0, the division results in overflow,orself % rhs != 0.
§Examples
Sourcepub const fnexact_div(self, rhs:i32) ->i32
🔬This is a nightly-only experimental API. (exact_div #139911)
pub const fnexact_div(self, rhs:i32) ->i32
exact_div #139911)Checked integer division without remainder. Computesself / rhs.
§Panics
This function will panic ifrhs == 0, the division results in overflow,orself % rhs != 0.
§Examples
Sourcepub const unsafe fnunchecked_exact_div(self, rhs:i32) ->i32
🔬This is a nightly-only experimental API. (exact_div #139911)
pub const unsafe fnunchecked_exact_div(self, rhs:i32) ->i32
exact_div #139911)Unchecked integer division without remainder. Computesself / rhs.
§Safety
This results in undefined behavior whenrhs == 0,self % rhs != 0, orself == i32::MIN && rhs == -1,i.e. whenchecked_exact_div would returnNone.
1.7.0 (const: 1.52.0) ·Sourcepub const fnchecked_rem(self, rhs:i32) ->Option<i32>
pub const fnchecked_rem(self, rhs:i32) ->Option<i32>
Checked integer remainder. Computesself % rhs, returningNone ifrhs == 0 or the division results in overflow.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_rem(self, rhs:i32) ->i32
pub const fnstrict_rem(self, rhs:i32) ->i32
Strict integer remainder. Computesself % rhs, panicking ifthe division results in overflow.
§Panics
This function will panic ifrhs is zero.
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
The only case where such an overflow can occur isx % y forMIN / -1 on asigned type (whereMIN is the negative minimal value), which is invalid due to implementation artifacts.
§Examples
The following panics because of division by zero:
The following panics because of overflow:
1.38.0 (const: 1.52.0) ·Sourcepub const fnchecked_rem_euclid(self, rhs:i32) ->Option<i32>
pub const fnchecked_rem_euclid(self, rhs:i32) ->Option<i32>
Checked Euclidean remainder. Computesself.rem_euclid(rhs), returningNoneifrhs == 0 or the division results in overflow.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_rem_euclid(self, rhs:i32) ->i32
pub const fnstrict_rem_euclid(self, rhs:i32) ->i32
Strict Euclidean remainder. Computesself.rem_euclid(rhs), panicking ifthe division results in overflow.
§Panics
This function will panic ifrhs is zero.
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
The only case where such an overflow can occur isx % y forMIN / -1 on asigned type (whereMIN is the negative minimal value), which is invalid due to implementation artifacts.
§Examples
The following panics because of division by zero:
The following panics because of overflow:
1.7.0 (const: 1.47.0) ·Sourcepub const fnchecked_neg(self) ->Option<i32>
pub const fnchecked_neg(self) ->Option<i32>
Checked negation. Computes-self, returningNone ifself == MIN.
§Examples
Sourcepub const unsafe fnunchecked_neg(self) ->i32
🔬This is a nightly-only experimental API. (unchecked_neg #85122)
pub const unsafe fnunchecked_neg(self) ->i32
unchecked_neg #85122)Unchecked negation. Computes-self, assuming overflow cannot occur.
§Safety
This results in undefined behavior whenself == i32::MIN,i.e. whenchecked_neg would returnNone.
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_neg(self) ->i32
pub const fnstrict_neg(self) ->i32
1.7.0 (const: 1.47.0) ·Sourcepub const fnchecked_shl(self, rhs:u32) ->Option<i32>
pub const fnchecked_shl(self, rhs:u32) ->Option<i32>
Checked shift left. Computesself << rhs, returningNone ifrhs is largerthan or equal to the number of bits inself.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_shl(self, rhs:u32) ->i32
pub const fnstrict_shl(self, rhs:u32) ->i32
Sourcepub const unsafe fnunchecked_shl(self, rhs:u32) ->i32
🔬This is a nightly-only experimental API. (unchecked_shifts #85122)
pub const unsafe fnunchecked_shl(self, rhs:u32) ->i32
unchecked_shifts #85122)Unchecked shift left. Computesself << rhs, assuming thatrhs is less than the number of bits inself.
§Safety
This results in undefined behavior ifrhs is larger thanor equal to the number of bits inself,i.e. whenchecked_shl would returnNone.
1.87.0 (const: 1.87.0) ·Sourcepub const fnunbounded_shl(self, rhs:u32) ->i32
pub const fnunbounded_shl(self, rhs:u32) ->i32
Unbounded shift left. Computesself << rhs, without bounding the value ofrhs.
Ifrhs is larger or equal to the number of bits inself,the entire value is shifted out, and0 is returned.
§Examples
Sourcepub const fnexact_shl(self, rhs:u32) ->Option<i32>
🔬This is a nightly-only experimental API. (exact_bitshifts #144336)
pub const fnexact_shl(self, rhs:u32) ->Option<i32>
exact_bitshifts #144336)Exact shift left. Computesself << rhs as long as it can be reversed losslessly.
ReturnsNone if any bits that would be shifted out differ from the resulting sign bitor ifrhs >=i32::BITS.Otherwise, returnsSome(self << rhs).
§Examples
#![feature(exact_bitshifts)]assert_eq!(0x1i32.exact_shl(4),Some(0x10));assert_eq!(0x1i32.exact_shl(i32::BITS -2),Some(1<< i32::BITS -2));assert_eq!(0x1i32.exact_shl(i32::BITS -1),None);assert_eq!((-0x2i32).exact_shl(i32::BITS -2),Some(-0x2<< i32::BITS -2));assert_eq!((-0x2i32).exact_shl(i32::BITS -1),None);Sourcepub const unsafe fnunchecked_exact_shl(self, rhs:u32) ->i32
🔬This is a nightly-only experimental API. (exact_bitshifts #144336)
pub const unsafe fnunchecked_exact_shl(self, rhs:u32) ->i32
exact_bitshifts #144336)Unchecked exact shift left. Computesself << rhs, assuming the operation can belosslessly reversed andrhs cannot be larger thani32::BITS.
§Safety
This results in undefined behavior whenrhs >= self.leading_zeros() && rhs >= self.leading_ones() i.e. wheni32::exact_shlwould returnNone.
1.7.0 (const: 1.47.0) ·Sourcepub const fnchecked_shr(self, rhs:u32) ->Option<i32>
pub const fnchecked_shr(self, rhs:u32) ->Option<i32>
Checked shift right. Computesself >> rhs, returningNone ifrhs islarger than or equal to the number of bits inself.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_shr(self, rhs:u32) ->i32
pub const fnstrict_shr(self, rhs:u32) ->i32
Sourcepub const unsafe fnunchecked_shr(self, rhs:u32) ->i32
🔬This is a nightly-only experimental API. (unchecked_shifts #85122)
pub const unsafe fnunchecked_shr(self, rhs:u32) ->i32
unchecked_shifts #85122)Unchecked shift right. Computesself >> rhs, assuming thatrhs is less than the number of bits inself.
§Safety
This results in undefined behavior ifrhs is larger thanor equal to the number of bits inself,i.e. whenchecked_shr would returnNone.
1.87.0 (const: 1.87.0) ·Sourcepub const fnunbounded_shr(self, rhs:u32) ->i32
pub const fnunbounded_shr(self, rhs:u32) ->i32
Unbounded shift right. Computesself >> rhs, without bounding the value ofrhs.
Ifrhs is larger or equal to the number of bits inself,the entire value is shifted out, which yields0 for a positive number,and-1 for a negative number.
§Examples
Sourcepub const fnexact_shr(self, rhs:u32) ->Option<i32>
🔬This is a nightly-only experimental API. (exact_bitshifts #144336)
pub const fnexact_shr(self, rhs:u32) ->Option<i32>
exact_bitshifts #144336)Exact shift right. Computesself >> rhs as long as it can be reversed losslessly.
ReturnsNone if any non-zero bits would be shifted out or ifrhs >=i32::BITS.Otherwise, returnsSome(self >> rhs).
§Examples
Sourcepub const unsafe fnunchecked_exact_shr(self, rhs:u32) ->i32
🔬This is a nightly-only experimental API. (exact_bitshifts #144336)
pub const unsafe fnunchecked_exact_shr(self, rhs:u32) ->i32
exact_bitshifts #144336)Unchecked exact shift right. Computesself >> rhs, assuming the operation can belosslessly reversed andrhs cannot be larger thani32::BITS.
§Safety
This results in undefined behavior whenrhs > self.trailing_zeros() || rhs >= i32::BITSi.e. wheni32::exact_shrwould returnNone.
1.13.0 (const: 1.47.0) ·Sourcepub const fnchecked_abs(self) ->Option<i32>
pub const fnchecked_abs(self) ->Option<i32>
Checked absolute value. Computesself.abs(), returningNone ifself == MIN.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_abs(self) ->i32
pub const fnstrict_abs(self) ->i32
1.34.0 (const: 1.50.0) ·Sourcepub const fnchecked_pow(self, exp:u32) ->Option<i32>
pub const fnchecked_pow(self, exp:u32) ->Option<i32>
Checked exponentiation. Computesself.pow(exp), returningNone ifoverflow occurred.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_pow(self, exp:u32) ->i32
pub const fnstrict_pow(self, exp:u32) ->i32
1.84.0 (const: 1.84.0) ·Sourcepub const fnchecked_isqrt(self) ->Option<i32>
pub const fnchecked_isqrt(self) ->Option<i32>
1.0.0 (const: 1.47.0) ·Sourcepub const fnsaturating_add(self, rhs:i32) ->i32
pub const fnsaturating_add(self, rhs:i32) ->i32
Saturating integer addition. Computesself + rhs, saturating at the numericbounds instead of overflowing.
§Examples
1.66.0 (const: 1.66.0) ·Sourcepub const fnsaturating_add_unsigned(self, rhs:u32) ->i32
pub const fnsaturating_add_unsigned(self, rhs:u32) ->i32
Saturating addition with an unsigned integer. Computesself + rhs,saturating at the numeric bounds instead of overflowing.
§Examples
1.0.0 (const: 1.47.0) ·Sourcepub const fnsaturating_sub(self, rhs:i32) ->i32
pub const fnsaturating_sub(self, rhs:i32) ->i32
Saturating integer subtraction. Computesself - rhs, saturating at thenumeric bounds instead of overflowing.
§Examples
1.66.0 (const: 1.66.0) ·Sourcepub const fnsaturating_sub_unsigned(self, rhs:u32) ->i32
pub const fnsaturating_sub_unsigned(self, rhs:u32) ->i32
Saturating subtraction with an unsigned integer. Computesself - rhs,saturating at the numeric bounds instead of overflowing.
§Examples
1.45.0 (const: 1.47.0) ·Sourcepub const fnsaturating_neg(self) ->i32
pub const fnsaturating_neg(self) ->i32
Saturating integer negation. Computes-self, returningMAX ifself == MINinstead of overflowing.
§Examples
1.45.0 (const: 1.47.0) ·Sourcepub const fnsaturating_abs(self) ->i32
pub const fnsaturating_abs(self) ->i32
Saturating absolute value. Computesself.abs(), returningMAX ifself == MIN instead of overflowing.
§Examples
1.7.0 (const: 1.47.0) ·Sourcepub const fnsaturating_mul(self, rhs:i32) ->i32
pub const fnsaturating_mul(self, rhs:i32) ->i32
Saturating integer multiplication. Computesself * rhs, saturating at thenumeric bounds instead of overflowing.
§Examples
1.58.0 (const: 1.58.0) ·Sourcepub const fnsaturating_div(self, rhs:i32) ->i32
pub const fnsaturating_div(self, rhs:i32) ->i32
1.34.0 (const: 1.50.0) ·Sourcepub const fnsaturating_pow(self, exp:u32) ->i32
pub const fnsaturating_pow(self, exp:u32) ->i32
Saturating integer exponentiation. Computesself.pow(exp),saturating at the numeric bounds instead of overflowing.
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnwrapping_add(self, rhs:i32) ->i32
pub const fnwrapping_add(self, rhs:i32) ->i32
Wrapping (modular) addition. Computesself + rhs, wrapping around at theboundary of the type.
§Examples
1.66.0 (const: 1.66.0) ·Sourcepub const fnwrapping_add_unsigned(self, rhs:u32) ->i32
pub const fnwrapping_add_unsigned(self, rhs:u32) ->i32
Wrapping (modular) addition with an unsigned integer. Computesself + rhs, wrapping around at the boundary of the type.
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnwrapping_sub(self, rhs:i32) ->i32
pub const fnwrapping_sub(self, rhs:i32) ->i32
Wrapping (modular) subtraction. Computesself - rhs, wrapping around at theboundary of the type.
§Examples
1.66.0 (const: 1.66.0) ·Sourcepub const fnwrapping_sub_unsigned(self, rhs:u32) ->i32
pub const fnwrapping_sub_unsigned(self, rhs:u32) ->i32
Wrapping (modular) subtraction with an unsigned integer. Computesself - rhs, wrapping around at the boundary of the type.
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnwrapping_mul(self, rhs:i32) ->i32
pub const fnwrapping_mul(self, rhs:i32) ->i32
Wrapping (modular) multiplication. Computesself * rhs, wrapping around atthe boundary of the type.
§Examples
1.2.0 (const: 1.52.0) ·Sourcepub const fnwrapping_div(self, rhs:i32) ->i32
pub const fnwrapping_div(self, rhs:i32) ->i32
Wrapping (modular) division. Computesself / rhs, wrapping around at theboundary of the type.
The only case where such wrapping can occur is when one dividesMIN / -1 on a signed type (whereMIN is the negative minimal value for the type); this is equivalent to-MIN, a positive valuethat is too large to represent in the type. In such a case, this function returnsMIN itself.
§Panics
This function will panic ifrhs is zero.
§Examples
1.38.0 (const: 1.52.0) ·Sourcepub const fnwrapping_div_euclid(self, rhs:i32) ->i32
pub const fnwrapping_div_euclid(self, rhs:i32) ->i32
Wrapping Euclidean division. Computesself.div_euclid(rhs),wrapping around at the boundary of the type.
Wrapping will only occur inMIN / -1 on a signed type (whereMIN is the negative minimal valuefor the type). This is equivalent to-MIN, a positive value that is too large to represent in thetype. In this case, this method returnsMIN itself.
§Panics
This function will panic ifrhs is zero.
§Examples
1.2.0 (const: 1.52.0) ·Sourcepub const fnwrapping_rem(self, rhs:i32) ->i32
pub const fnwrapping_rem(self, rhs:i32) ->i32
Wrapping (modular) remainder. Computesself % rhs, wrapping around at theboundary of the type.
Such wrap-around never actually occurs mathematically; implementation artifacts makex % yinvalid forMIN / -1 on a signed type (whereMIN is the negative minimal value). In such a case,this function returns0.
§Panics
This function will panic ifrhs is zero.
§Examples
1.38.0 (const: 1.52.0) ·Sourcepub const fnwrapping_rem_euclid(self, rhs:i32) ->i32
pub const fnwrapping_rem_euclid(self, rhs:i32) ->i32
Wrapping Euclidean remainder. Computesself.rem_euclid(rhs), wrapping aroundat the boundary of the type.
Wrapping will only occur inMIN % -1 on a signed type (whereMIN is the negative minimal valuefor the type). In this case, this method returns 0.
§Panics
This function will panic ifrhs is zero.
§Examples
1.2.0 (const: 1.32.0) ·Sourcepub const fnwrapping_neg(self) ->i32
pub const fnwrapping_neg(self) ->i32
Wrapping (modular) negation. Computes-self, wrapping around at the boundaryof the type.
The only case where such wrapping can occur is when one negatesMIN on a signed type (whereMINis the negative minimal value for the type); this is a positive value that is too large to representin the type. In such a case, this function returnsMIN itself.
§Examples
1.2.0 (const: 1.32.0) ·Sourcepub const fnwrapping_shl(self, rhs:u32) ->i32
pub const fnwrapping_shl(self, rhs:u32) ->i32
Panic-free bitwise shift-left; yieldsself << mask(rhs), wheremask removesany high-order bits ofrhs that would cause the shift to exceed the bitwidth of the type.
Note that this isnot the same as a rotate-left; the RHS of a wrapping shift-left is restricted tothe range of the type, rather than the bits shifted out of the LHS being returned to the other end.The primitive integer types all implement arotate_left function,which may be what you want instead.
§Examples
1.2.0 (const: 1.32.0) ·Sourcepub const fnwrapping_shr(self, rhs:u32) ->i32
pub const fnwrapping_shr(self, rhs:u32) ->i32
Panic-free bitwise shift-right; yieldsself >> mask(rhs), wheremaskremoves any high-order bits ofrhs that would cause the shift to exceed the bitwidth of the type.
Note that this isnot the same as a rotate-right; the RHS of a wrapping shift-right is restrictedto the range of the type, rather than the bits shifted out of the LHS being returned to the otherend. The primitive integer types all implement arotate_right function,which may be what you want instead.
§Examples
1.13.0 (const: 1.32.0) ·Sourcepub const fnwrapping_abs(self) ->i32
pub const fnwrapping_abs(self) ->i32
Wrapping (modular) absolute value. Computesself.abs(), wrapping around atthe boundary of the type.
The only case where such wrapping can occur is when one takes the absolute value of the negativeminimal value for the type; this is a positive value that is too large to represent in the type. Insuch a case, this function returnsMIN itself.
§Examples
1.51.0 (const: 1.51.0) ·Sourcepub const fnunsigned_abs(self) ->u32
pub const fnunsigned_abs(self) ->u32
Computes the absolute value ofself without any wrappingor panicking.
§Examples
1.34.0 (const: 1.50.0) ·Sourcepub const fnwrapping_pow(self, exp:u32) ->i32
pub const fnwrapping_pow(self, exp:u32) ->i32
Wrapping (modular) exponentiation. Computesself.pow(exp),wrapping around at the boundary of the type.
§Examples
1.7.0 (const: 1.32.0) ·Sourcepub const fnoverflowing_add(self, rhs:i32) -> (i32,bool)
pub const fnoverflowing_add(self, rhs:i32) -> (i32,bool)
Calculatesself +rhs.
Returns a tuple of the addition along with a boolean indicatingwhether an arithmetic overflow would occur. If an overflow would haveoccurred then the wrapped value is returned.
§Examples
Sourcepub const fncarrying_add(self, rhs:i32, carry:bool) -> (i32,bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods #85532)
pub const fncarrying_add(self, rhs:i32, carry:bool) -> (i32,bool)
bigint_helper_methods #85532)Calculatesself +rhs +carry and checks for overflow.
Performs “ternary addition” of two integer operands and a carry-inbit, and returns a tuple of the sum along with a boolean indicatingwhether an arithmetic overflow would occur. On overflow, the wrappedvalue is returned.
This allows chaining together multiple additions to create a wideraddition, and can be useful for bignum addition. This method shouldonly be used for the most significant word; for the less significantwords the unsigned methodu32::carrying_addshould be used.
The output boolean returned by this method isnot a carry flag,and shouldnot be added to a more significant word.
If the input carry is false, this method is equivalent tooverflowing_add.
§Examples
#![feature(bigint_helper_methods)]// Only the most significant word is signed.//// 10 MAX (a = 10 × 2^32 + 2^32 - 1)// + -5 9 (b = -5 × 2^32 + 9)// ---------// 6 8 (sum = 6 × 2^32 + 8)let(a1, a0): (i32, u32) = (10, u32::MAX);let(b1, b0): (i32, u32) = (-5,9);letcarry0 =false;// u32::carrying_add for the less significant wordslet(sum0, carry1) = a0.carrying_add(b0, carry0);assert_eq!(carry1,true);// i32::carrying_add for the most significant wordlet(sum1, overflow) = a1.carrying_add(b1, carry1);assert_eq!(overflow,false);assert_eq!((sum1, sum0), (6,8));1.66.0 (const: 1.66.0) ·Sourcepub const fnoverflowing_add_unsigned(self, rhs:u32) -> (i32,bool)
pub const fnoverflowing_add_unsigned(self, rhs:u32) -> (i32,bool)
Calculatesself +rhs with an unsignedrhs.
Returns a tuple of the addition along with a boolean indicatingwhether an arithmetic overflow would occur. If an overflow wouldhave occurred then the wrapped value is returned.
§Examples
1.7.0 (const: 1.32.0) ·Sourcepub const fnoverflowing_sub(self, rhs:i32) -> (i32,bool)
pub const fnoverflowing_sub(self, rhs:i32) -> (i32,bool)
Calculatesself -rhs.
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflowwould occur. If an overflow would have occurred then the wrapped value is returned.
§Examples
Sourcepub const fnborrowing_sub(self, rhs:i32, borrow:bool) -> (i32,bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods #85532)
pub const fnborrowing_sub(self, rhs:i32, borrow:bool) -> (i32,bool)
bigint_helper_methods #85532)Calculatesself −rhs −borrow and checks foroverflow.
Performs “ternary subtraction” by subtracting both an integeroperand and a borrow-in bit fromself, and returns a tuple of thedifference along with a boolean indicating whether an arithmeticoverflow would occur. On overflow, the wrapped value is returned.
This allows chaining together multiple subtractions to create awider subtraction, and can be useful for bignum subtraction. Thismethod should only be used for the most significant word; for theless significant words the unsigned methodu32::borrowing_subshould be used.
The output boolean returned by this method isnot a borrow flag,and shouldnot be subtracted from a more significant word.
If the input borrow is false, this method is equivalent tooverflowing_sub.
§Examples
#![feature(bigint_helper_methods)]// Only the most significant word is signed.//// 6 8 (a = 6 × 2^32 + 8)// - -5 9 (b = -5 × 2^32 + 9)// ---------// 10 MAX (diff = 10 × 2^32 + 2^32 - 1)let(a1, a0): (i32, u32) = (6,8);let(b1, b0): (i32, u32) = (-5,9);letborrow0 =false;// u32::borrowing_sub for the less significant wordslet(diff0, borrow1) = a0.borrowing_sub(b0, borrow0);assert_eq!(borrow1,true);// i32::borrowing_sub for the most significant wordlet(diff1, overflow) = a1.borrowing_sub(b1, borrow1);assert_eq!(overflow,false);assert_eq!((diff1, diff0), (10, u32::MAX));1.66.0 (const: 1.66.0) ·Sourcepub const fnoverflowing_sub_unsigned(self, rhs:u32) -> (i32,bool)
pub const fnoverflowing_sub_unsigned(self, rhs:u32) -> (i32,bool)
Calculatesself -rhs with an unsignedrhs.
Returns a tuple of the subtraction along with a boolean indicatingwhether an arithmetic overflow would occur. If an overflow wouldhave occurred then the wrapped value is returned.
§Examples
1.7.0 (const: 1.32.0) ·Sourcepub const fnoverflowing_mul(self, rhs:i32) -> (i32,bool)
pub const fnoverflowing_mul(self, rhs:i32) -> (i32,bool)
Calculates the multiplication ofself andrhs.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflowwould occur. If an overflow would have occurred then the wrapped value is returned.
§Examples
Sourcepub const fnwidening_mul(self, rhs:i32) -> (u32,i32)
🔬This is a nightly-only experimental API. (bigint_helper_methods #85532)
pub const fnwidening_mul(self, rhs:i32) -> (u32,i32)
bigint_helper_methods #85532)Calculates the complete productself * rhs without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bitsof the result as two separate values, in that order.
If you also need to add a carry to the wide result, then you wantSelf::carrying_mul instead.
§Examples
Please note that this example is shared among integer types, which is whyi32 is used.
Sourcepub const fncarrying_mul(self, rhs:i32, carry:i32) -> (u32,i32)
🔬This is a nightly-only experimental API. (bigint_helper_methods #85532)
pub const fncarrying_mul(self, rhs:i32, carry:i32) -> (u32,i32)
bigint_helper_methods #85532)Calculates the “full multiplication”self * rhs + carrywithout the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bitsof the result as two separate values, in that order.
Performs “long multiplication” which takes in an extra amount to add, and may return anadditional amount of overflow. This allows for chaining together multiplemultiplications to create “big integers” which represent larger values.
If you don’t need thecarry, then you can useSelf::widening_mul instead.
§Examples
Please note that this example is shared among integer types, which is whyi32 is used.
#![feature(bigint_helper_methods)]assert_eq!(5i32.carrying_mul(-2,0), (4294967286, -1));assert_eq!(5i32.carrying_mul(-2,10), (0,0));assert_eq!(1_000_000_000i32.carrying_mul(-10,0), (2884901888, -3));assert_eq!(1_000_000_000i32.carrying_mul(-10,10), (2884901898, -3));assert_eq!(i32::MAX.carrying_mul(i32::MAX, i32::MAX), (i32::MAX.unsigned_abs() +1, i32::MAX /2));Sourcepub const fncarrying_mul_add( self, rhs:i32, carry:i32, add:i32,) -> (u32,i32)
🔬This is a nightly-only experimental API. (bigint_helper_methods #85532)
pub const fncarrying_mul_add( self, rhs:i32, carry:i32, add:i32,) -> (u32,i32)
bigint_helper_methods #85532)Calculates the “full multiplication”self * rhs + carry1 + carry2without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bitsof the result as two separate values, in that order.
Performs “long multiplication” which takes in an extra amount to add, and may return anadditional amount of overflow. This allows for chaining together multiplemultiplications to create “big integers” which represent larger values.
If you don’t need eithercarry, then you can useSelf::widening_mul instead,and if you only need onecarry, then you can useSelf::carrying_mul instead.
§Examples
Please note that this example is shared among integer types, which is whyi32 is used.
#![feature(bigint_helper_methods)]assert_eq!(5i32.carrying_mul_add(-2,0,0), (4294967286, -1));assert_eq!(5i32.carrying_mul_add(-2,10,10), (10,0));assert_eq!(1_000_000_000i32.carrying_mul_add(-10,0,0), (2884901888, -3));assert_eq!(1_000_000_000i32.carrying_mul_add(-10,10,10), (2884901908, -3));assert_eq!(i32::MAX.carrying_mul_add(i32::MAX, i32::MAX, i32::MAX), (u32::MAX, i32::MAX /2));1.7.0 (const: 1.52.0) ·Sourcepub const fnoverflowing_div(self, rhs:i32) -> (i32,bool)
pub const fnoverflowing_div(self, rhs:i32) -> (i32,bool)
1.38.0 (const: 1.52.0) ·Sourcepub const fnoverflowing_div_euclid(self, rhs:i32) -> (i32,bool)
pub const fnoverflowing_div_euclid(self, rhs:i32) -> (i32,bool)
1.7.0 (const: 1.52.0) ·Sourcepub const fnoverflowing_rem(self, rhs:i32) -> (i32,bool)
pub const fnoverflowing_rem(self, rhs:i32) -> (i32,bool)
1.38.0 (const: 1.52.0) ·Sourcepub const fnoverflowing_rem_euclid(self, rhs:i32) -> (i32,bool)
pub const fnoverflowing_rem_euclid(self, rhs:i32) -> (i32,bool)
1.7.0 (const: 1.32.0) ·Sourcepub const fnoverflowing_neg(self) -> (i32,bool)
pub const fnoverflowing_neg(self) -> (i32,bool)
Negates self, overflowing if this is equal to the minimum value.
Returns a tuple of the negated version of self along with a boolean indicating whether an overflowhappened. Ifself is the minimum value (e.g.,i32::MIN for values of typei32), then theminimum value will be returned again andtrue will be returned for an overflow happening.
§Examples
1.7.0 (const: 1.32.0) ·Sourcepub const fnoverflowing_shl(self, rhs:u32) -> (i32,bool)
pub const fnoverflowing_shl(self, rhs:u32) -> (i32,bool)
Shifts self left byrhs bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shiftvalue was larger than or equal to the number of bits. If the shift value is too large, then value ismasked (N-1) where N is the number of bits, and this value is then used to perform the shift.
§Examples
1.7.0 (const: 1.32.0) ·Sourcepub const fnoverflowing_shr(self, rhs:u32) -> (i32,bool)
pub const fnoverflowing_shr(self, rhs:u32) -> (i32,bool)
Shifts self right byrhs bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shiftvalue was larger than or equal to the number of bits. If the shift value is too large, then value ismasked (N-1) where N is the number of bits, and this value is then used to perform the shift.
§Examples
1.13.0 (const: 1.32.0) ·Sourcepub const fnoverflowing_abs(self) -> (i32,bool)
pub const fnoverflowing_abs(self) -> (i32,bool)
Computes the absolute value ofself.
Returns a tuple of the absolute version of self along with a boolean indicating whether an overflowhappened. If self is the minimum value(e.g., i32::MIN for values of type i32),then the minimum value will be returned again and true will be returnedfor an overflow happening.
§Examples
1.34.0 (const: 1.50.0) ·Sourcepub const fnoverflowing_pow(self, exp:u32) -> (i32,bool)
pub const fnoverflowing_pow(self, exp:u32) -> (i32,bool)
Raises self to the power ofexp, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicatingwhether an overflow happened.
§Examples
1.0.0 (const: 1.50.0) ·Sourcepub const fnpow(self, exp:u32) ->i32
pub const fnpow(self, exp:u32) ->i32
Raises self to the power ofexp, using exponentiation by squaring.
§Examples
1.38.0 (const: 1.52.0) ·Sourcepub const fndiv_euclid(self, rhs:i32) ->i32
pub const fndiv_euclid(self, rhs:i32) ->i32
Calculates the quotient of Euclidean division ofself byrhs.
This computes the integerq such thatself = q * rhs + r, withr = self.rem_euclid(rhs) and0 <= r < abs(rhs).
In other words, the result isself / rhs rounded to the integerqsuch thatself >= q * rhs.Ifself > 0, this is equal to rounding towards zero (the default in Rust);ifself < 0, this is equal to rounding away from zero (towards +/- infinity).Ifrhs > 0, this is equal to rounding towards -infinity;ifrhs < 0, this is equal to rounding towards +infinity.
§Panics
This function will panic ifrhs is zero or ifself isSelf::MINandrhs is -1. This behavior is not affected by theoverflow-checks flag.
§Examples
1.38.0 (const: 1.52.0) ·Sourcepub const fnrem_euclid(self, rhs:i32) ->i32
pub const fnrem_euclid(self, rhs:i32) ->i32
Calculates the least nonnegative remainder ofself (mod rhs).
This is done as if by the Euclidean division algorithm – givenr = self.rem_euclid(rhs), the result satisfiesself = rhs * self.div_euclid(rhs) + r and0 <= r < abs(rhs).
§Panics
This function will panic ifrhs is zero or ifself isSelf::MIN andrhs is -1. This behavior is not affected by theoverflow-checks flag.
§Examples
leta: i32 =7;// or any other integer typeletb =4;assert_eq!(a.rem_euclid(b),3);assert_eq!((-a).rem_euclid(b),1);assert_eq!(a.rem_euclid(-b),3);assert_eq!((-a).rem_euclid(-b),1);This will panic:
Sourcepub const fndiv_floor(self, rhs:i32) ->i32
🔬This is a nightly-only experimental API. (int_roundings #88581)
pub const fndiv_floor(self, rhs:i32) ->i32
int_roundings #88581)Sourcepub const fndiv_ceil(self, rhs:i32) ->i32
🔬This is a nightly-only experimental API. (int_roundings #88581)
pub const fndiv_ceil(self, rhs:i32) ->i32
int_roundings #88581)Sourcepub const fnnext_multiple_of(self, rhs:i32) ->i32
🔬This is a nightly-only experimental API. (int_roundings #88581)
pub const fnnext_multiple_of(self, rhs:i32) ->i32
int_roundings #88581)Ifrhs is positive, calculates the smallest value greater than orequal toself that is a multiple ofrhs. Ifrhs is negative,calculates the largest value less than or equal toself that is amultiple ofrhs.
§Panics
This function will panic ifrhs is zero.
§Overflow behavior
On overflow, this function will panic if overflow checks are enabled (default in debugmode) and wrap if overflow checks are disabled (default in release mode).
§Examples
#![feature(int_roundings)]assert_eq!(16_i32.next_multiple_of(8),16);assert_eq!(23_i32.next_multiple_of(8),24);assert_eq!(16_i32.next_multiple_of(-8),16);assert_eq!(23_i32.next_multiple_of(-8),16);assert_eq!((-16_i32).next_multiple_of(8), -16);assert_eq!((-23_i32).next_multiple_of(8), -16);assert_eq!((-16_i32).next_multiple_of(-8), -16);assert_eq!((-23_i32).next_multiple_of(-8), -24);Sourcepub const fnchecked_next_multiple_of(self, rhs:i32) ->Option<i32>
🔬This is a nightly-only experimental API. (int_roundings #88581)
pub const fnchecked_next_multiple_of(self, rhs:i32) ->Option<i32>
int_roundings #88581)Ifrhs is positive, calculates the smallest value greater than orequal toself that is a multiple ofrhs. Ifrhs is negative,calculates the largest value less than or equal toself that is amultiple ofrhs. ReturnsNone ifrhs is zero or the operationwould result in overflow.
§Examples
#![feature(int_roundings)]assert_eq!(16_i32.checked_next_multiple_of(8),Some(16));assert_eq!(23_i32.checked_next_multiple_of(8),Some(24));assert_eq!(16_i32.checked_next_multiple_of(-8),Some(16));assert_eq!(23_i32.checked_next_multiple_of(-8),Some(16));assert_eq!((-16_i32).checked_next_multiple_of(8),Some(-16));assert_eq!((-23_i32).checked_next_multiple_of(8),Some(-16));assert_eq!((-16_i32).checked_next_multiple_of(-8),Some(-16));assert_eq!((-23_i32).checked_next_multiple_of(-8),Some(-24));assert_eq!(1_i32.checked_next_multiple_of(0),None);assert_eq!(i32::MAX.checked_next_multiple_of(2),None);1.67.0 (const: 1.67.0) ·Sourcepub const fnilog(self, base:i32) ->u32
pub const fnilog(self, base:i32) ->u32
Returns the logarithm of the number with respect to an arbitrary base,rounded down.
This method might not be optimized owing to implementation details;ilog2 can produce results more efficiently for base 2, andilog10can produce results more efficiently for base 10.
§Panics
This function will panic ifself is less than or equal to zero,or ifbase is less than 2.
§Examples
1.67.0 (const: 1.67.0) ·Sourcepub const fnchecked_ilog(self, base:i32) ->Option<u32>
pub const fnchecked_ilog(self, base:i32) ->Option<u32>
Returns the logarithm of the number with respect to an arbitrary base,rounded down.
ReturnsNone if the number is negative or zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details;checked_ilog2 can produce results more efficiently for base 2, andchecked_ilog10 can produce results more efficiently for base 10.
§Examples
1.67.0 (const: 1.67.0) ·Sourcepub const fnchecked_ilog2(self) ->Option<u32>
pub const fnchecked_ilog2(self) ->Option<u32>
Returns the base 2 logarithm of the number, rounded down.
ReturnsNone if the number is negative or zero.
§Examples
1.67.0 (const: 1.67.0) ·Sourcepub const fnchecked_ilog10(self) ->Option<u32>
pub const fnchecked_ilog10(self) ->Option<u32>
Returns the base 10 logarithm of the number, rounded down.
ReturnsNone if the number is negative or zero.
§Example
1.0.0 (const: 1.32.0) ·Sourcepub const fnabs(self) ->i32
pub const fnabs(self) ->i32
Computes the absolute value ofself.
§Overflow behavior
The absolute value ofi32::MINcannot be represented as ani32,and attempting to calculate it will cause an overflow. This meansthat code in debug mode will trigger a panic on this case andoptimized code will returni32::MINwithout a panic. If you do not want this behavior, considerusingunsigned_abs instead.
§Examples
1.60.0 (const: 1.60.0) ·Sourcepub const fnabs_diff(self, other:i32) ->u32
pub const fnabs_diff(self, other:i32) ->u32
Computes the absolute difference betweenself andother.
This function always returns the correct answer without overflow orpanics by returning an unsigned integer.
§Examples
1.0.0 (const: 1.47.0) ·Sourcepub const fnsignum(self) ->i32
pub const fnsignum(self) ->i32
Returns a number representing sign ofself.
0if the number is zero1if the number is positive-1if the number is negative
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnis_positive(self) ->bool
pub const fnis_positive(self) ->bool
Returnstrue ifself is positive andfalse if the number is zero ornegative.
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnis_negative(self) ->bool
pub const fnis_negative(self) ->bool
Returnstrue ifself is negative andfalse if the number is zero orpositive.
§Examples
1.32.0 (const: 1.44.0) ·Sourcepub const fnto_be_bytes(self) -> [u8;4]
pub const fnto_be_bytes(self) -> [u8;4]
Returns the memory representation of this integer as a byte array inbig-endian (network) byte order.
§Examples
1.32.0 (const: 1.44.0) ·Sourcepub const fnto_le_bytes(self) -> [u8;4]
pub const fnto_le_bytes(self) -> [u8;4]
Returns the memory representation of this integer as a byte array inlittle-endian byte order.
§Examples
1.32.0 (const: 1.44.0) ·Sourcepub const fnto_ne_bytes(self) -> [u8;4]
pub const fnto_ne_bytes(self) -> [u8;4]
Returns the memory representation of this integer as a byte array innative byte order.
As the target platform’s native endianness is used, portable codeshould useto_be_bytes orto_le_bytes, as appropriate,instead.
§Examples
1.32.0 (const: 1.44.0) ·Sourcepub const fnfrom_be_bytes(bytes: [u8;4]) ->i32
pub const fnfrom_be_bytes(bytes: [u8;4]) ->i32
Creates an integer value from its representation as a byte array inbig endian.
§Examples
When starting from a slice rather than an array, fallible conversion APIs can be used:
1.32.0 (const: 1.44.0) ·Sourcepub const fnfrom_le_bytes(bytes: [u8;4]) ->i32
pub const fnfrom_le_bytes(bytes: [u8;4]) ->i32
Creates an integer value from its representation as a byte array inlittle endian.
§Examples
When starting from a slice rather than an array, fallible conversion APIs can be used:
1.32.0 (const: 1.44.0) ·Sourcepub const fnfrom_ne_bytes(bytes: [u8;4]) ->i32
pub const fnfrom_ne_bytes(bytes: [u8;4]) ->i32
Creates an integer value from its memory representation as a bytearray in native endianness.
As the target platform’s native endianness is used, portable codelikely wants to usefrom_be_bytes orfrom_le_bytes, asappropriate instead.
§Examples
letvalue = i32::from_ne_bytes(ifcfg!(target_endian ="big") { [0x12,0x34,0x56,0x78]}else{ [0x78,0x56,0x34,0x12]});assert_eq!(value,0x12345678);When starting from a slice rather than an array, fallible conversion APIs can be used:
1.0.0 (const: 1.32.0) ·Sourcepub const fnmin_value() ->i32
👎Deprecating in a future version: replaced by theMIN associated constant on this type
pub const fnmin_value() ->i32
MIN associated constant on this typeNew code should prefer to usei32::MIN instead.
Returns the smallest value that can be represented by this integer type.
1.0.0 (const: 1.32.0) ·Sourcepub const fnmax_value() ->i32
👎Deprecating in a future version: replaced by theMAX associated constant on this type
pub const fnmax_value() ->i32
MAX associated constant on this typeNew code should prefer to usei32::MAX instead.
Returns the largest value that can be represented by this integer type.
1.87.0 (const: 1.87.0) ·Sourcepub const fnmidpoint(self, rhs:i32) ->i32
pub const fnmidpoint(self, rhs:i32) ->i32
Calculates the midpoint (average) betweenself andrhs.
midpoint(a, b) is(a + b) / 2 as if it were performed in asufficiently-large signed integral type. This implies that the result isalways rounded towards zero and that no overflow will ever occur.
§Examples
Source§impli32
impli32
1.0.0 (const: 1.82.0) ·Sourcepub const fnfrom_str_radix(src: &str, radix:u32) ->Result<i32,ParseIntError>
pub const fnfrom_str_radix(src: &str, radix:u32) ->Result<i32,ParseIntError>
Parses an integer from a string slice with digits in a given base.
The string is expected to be an optional+ or-sign followed by only digits. Leading and trailing non-digit characters (includingwhitespace) represent an error. Underscores (which are accepted in Rust literals)also represent an error.
Digits are a subset of these characters, depending onradix:
0-9a-zA-Z
§Panics
This function panics ifradix is not in the range from 2 to 36.
§See also
If the string to be parsed is in base 10 (decimal),from_str orstr::parse can also be used.
§Examples
Trailing space returns error:
Sourcepub const fnfrom_ascii(src: &[u8]) ->Result<i32,ParseIntError>
🔬This is a nightly-only experimental API. (int_from_ascii #134821)
pub const fnfrom_ascii(src: &[u8]) ->Result<i32,ParseIntError>
int_from_ascii #134821)Parses an integer from an ASCII-byte slice with decimal digits.
The characters are expected to be an optional+ or-sign followed by only digits. Leading and trailing non-digit characters (includingwhitespace) represent an error. Underscores (which are accepted in Rust literals)also represent an error.
§Examples
Trailing space returns error:
Sourcepub const fnfrom_ascii_radix( src: &[u8], radix:u32,) ->Result<i32,ParseIntError>
🔬This is a nightly-only experimental API. (int_from_ascii #134821)
pub const fnfrom_ascii_radix( src: &[u8], radix:u32,) ->Result<i32,ParseIntError>
int_from_ascii #134821)Parses an integer from an ASCII-byte slice with digits in a given base.
The characters are expected to be an optional+ or-sign followed by only digits. Leading and trailing non-digit characters (includingwhitespace) represent an error. Underscores (which are accepted in Rust literals)also represent an error.
Digits are a subset of these characters, depending onradix:
0-9a-zA-Z
§Panics
This function panics ifradix is not in the range from 2 to 36.
§Examples
Trailing space returns error:
Trait Implementations§
1.74.0 (const:unstable) ·Source§implAddAssign<&i32> forSaturating<i32>
implAddAssign<&i32> forSaturating<i32>
Source§fnadd_assign(&mut self, other: &i32)
fnadd_assign(&mut self, other: &i32)
+= operation.Read more1.22.0 (const:unstable) ·Source§implAddAssign<&i32> forWrapping<i32>
implAddAssign<&i32> forWrapping<i32>
Source§fnadd_assign(&mut self, other: &i32)
fnadd_assign(&mut self, other: &i32)
+= operation.Read more1.22.0 (const:unstable) ·Source§implAddAssign<&i32> fori32
implAddAssign<&i32> fori32
Source§fnadd_assign(&mut self, other: &i32)
fnadd_assign(&mut self, other: &i32)
+= operation.Read more1.74.0 (const:unstable) ·Source§implAddAssign<i32> forSaturating<i32>
implAddAssign<i32> forSaturating<i32>
Source§fnadd_assign(&mut self, other:i32)
fnadd_assign(&mut self, other:i32)
+= operation.Read more1.60.0 (const:unstable) ·Source§implAddAssign<i32> forWrapping<i32>
implAddAssign<i32> forWrapping<i32>
Source§fnadd_assign(&mut self, other:i32)
fnadd_assign(&mut self, other:i32)
+= operation.Read more1.8.0 (const:unstable) ·Source§implAddAssign fori32
implAddAssign fori32
Source§fnadd_assign(&mut self, other:i32)
fnadd_assign(&mut self, other:i32)
+= operation.Read moreSource§implAtomicPrimitive fori32
implAtomicPrimitive fori32
Source§typeAtomicInner =AtomicI32
typeAtomicInner =AtomicI32
atomic_internals)1.74.0 (const:unstable) ·Source§implBitAndAssign<&i32> forSaturating<i32>
implBitAndAssign<&i32> forSaturating<i32>
Source§fnbitand_assign(&mut self, other: &i32)
fnbitand_assign(&mut self, other: &i32)
&= operation.Read more1.22.0 (const:unstable) ·Source§implBitAndAssign<&i32> forWrapping<i32>
implBitAndAssign<&i32> forWrapping<i32>
Source§fnbitand_assign(&mut self, other: &i32)
fnbitand_assign(&mut self, other: &i32)
&= operation.Read more1.22.0 (const:unstable) ·Source§implBitAndAssign<&i32> fori32
implBitAndAssign<&i32> fori32
Source§fnbitand_assign(&mut self, other: &i32)
fnbitand_assign(&mut self, other: &i32)
&= operation.Read more1.74.0 (const:unstable) ·Source§implBitAndAssign<i32> forSaturating<i32>
implBitAndAssign<i32> forSaturating<i32>
Source§fnbitand_assign(&mut self, other:i32)
fnbitand_assign(&mut self, other:i32)
&= operation.Read more1.60.0 (const:unstable) ·Source§implBitAndAssign<i32> forWrapping<i32>
implBitAndAssign<i32> forWrapping<i32>
Source§fnbitand_assign(&mut self, other:i32)
fnbitand_assign(&mut self, other:i32)
&= operation.Read more1.8.0 (const:unstable) ·Source§implBitAndAssign fori32
implBitAndAssign fori32
Source§fnbitand_assign(&mut self, other:i32)
fnbitand_assign(&mut self, other:i32)
&= operation.Read more1.74.0 (const:unstable) ·Source§implBitOrAssign<&i32> forSaturating<i32>
implBitOrAssign<&i32> forSaturating<i32>
Source§fnbitor_assign(&mut self, other: &i32)
fnbitor_assign(&mut self, other: &i32)
|= operation.Read more1.22.0 (const:unstable) ·Source§implBitOrAssign<&i32> forWrapping<i32>
implBitOrAssign<&i32> forWrapping<i32>
Source§fnbitor_assign(&mut self, other: &i32)
fnbitor_assign(&mut self, other: &i32)
|= operation.Read more1.22.0 (const:unstable) ·Source§implBitOrAssign<&i32> fori32
implBitOrAssign<&i32> fori32
Source§fnbitor_assign(&mut self, other: &i32)
fnbitor_assign(&mut self, other: &i32)
|= operation.Read more1.74.0 (const:unstable) ·Source§implBitOrAssign<i32> forSaturating<i32>
implBitOrAssign<i32> forSaturating<i32>
Source§fnbitor_assign(&mut self, other:i32)
fnbitor_assign(&mut self, other:i32)
|= operation.Read more1.60.0 (const:unstable) ·Source§implBitOrAssign<i32> forWrapping<i32>
implBitOrAssign<i32> forWrapping<i32>
Source§fnbitor_assign(&mut self, other:i32)
fnbitor_assign(&mut self, other:i32)
|= operation.Read more1.8.0 (const:unstable) ·Source§implBitOrAssign fori32
implBitOrAssign fori32
Source§fnbitor_assign(&mut self, other:i32)
fnbitor_assign(&mut self, other:i32)
|= operation.Read more1.74.0 (const:unstable) ·Source§implBitXorAssign<&i32> forSaturating<i32>
implBitXorAssign<&i32> forSaturating<i32>
Source§fnbitxor_assign(&mut self, other: &i32)
fnbitxor_assign(&mut self, other: &i32)
^= operation.Read more1.22.0 (const:unstable) ·Source§implBitXorAssign<&i32> forWrapping<i32>
implBitXorAssign<&i32> forWrapping<i32>
Source§fnbitxor_assign(&mut self, other: &i32)
fnbitxor_assign(&mut self, other: &i32)
^= operation.Read more1.22.0 (const:unstable) ·Source§implBitXorAssign<&i32> fori32
implBitXorAssign<&i32> fori32
Source§fnbitxor_assign(&mut self, other: &i32)
fnbitxor_assign(&mut self, other: &i32)
^= operation.Read more1.74.0 (const:unstable) ·Source§implBitXorAssign<i32> forSaturating<i32>
implBitXorAssign<i32> forSaturating<i32>
Source§fnbitxor_assign(&mut self, other:i32)
fnbitxor_assign(&mut self, other:i32)
^= operation.Read more1.60.0 (const:unstable) ·Source§implBitXorAssign<i32> forWrapping<i32>
implBitXorAssign<i32> forWrapping<i32>
Source§fnbitxor_assign(&mut self, other:i32)
fnbitxor_assign(&mut self, other:i32)
^= operation.Read more1.8.0 (const:unstable) ·Source§implBitXorAssign fori32
implBitXorAssign fori32
Source§fnbitxor_assign(&mut self, other:i32)
fnbitxor_assign(&mut self, other:i32)
^= operation.Read moreSource§implCarryingMulAdd fori32
implCarryingMulAdd fori32
Source§implDisjointBitOr fori32
implDisjointBitOr fori32
Source§unsafe fndisjoint_bitor(self, other:i32) ->i32
unsafe fndisjoint_bitor(self, other:i32) ->i32
core_intrinsics_fallbacks)super::disjoint_bitor; we just need the trait indirection to handledifferent types since calling intrinsics with generics doesn’t work.Source§implDistribution<i32> forRangeFull
implDistribution<i32> forRangeFull
1.0.0 (const:unstable) ·Source§implDiv fori32
This operation rounds towards zero, truncating anyfractional part of the exact result.
implDiv fori32
This operation rounds towards zero, truncating anyfractional part of the exact result.
§Panics
This operation will panic ifother == 0 or the division results in overflow.
1.74.0 (const:unstable) ·Source§implDivAssign<&i32> forSaturating<i32>
implDivAssign<&i32> forSaturating<i32>
Source§fndiv_assign(&mut self, other: &i32)
fndiv_assign(&mut self, other: &i32)
/= operation.Read more1.22.0 (const:unstable) ·Source§implDivAssign<&i32> forWrapping<i32>
implDivAssign<&i32> forWrapping<i32>
Source§fndiv_assign(&mut self, other: &i32)
fndiv_assign(&mut self, other: &i32)
/= operation.Read more1.22.0 (const:unstable) ·Source§implDivAssign<&i32> fori32
implDivAssign<&i32> fori32
Source§fndiv_assign(&mut self, other: &i32)
fndiv_assign(&mut self, other: &i32)
/= operation.Read more1.74.0 (const:unstable) ·Source§implDivAssign<i32> forSaturating<i32>
implDivAssign<i32> forSaturating<i32>
Source§fndiv_assign(&mut self, other:i32)
fndiv_assign(&mut self, other:i32)
/= operation.Read more1.60.0 (const:unstable) ·Source§implDivAssign<i32> forWrapping<i32>
implDivAssign<i32> forWrapping<i32>
Source§fndiv_assign(&mut self, other:i32)
fndiv_assign(&mut self, other:i32)
/= operation.Read more1.8.0 (const:unstable) ·Source§implDivAssign fori32
implDivAssign fori32
Source§fndiv_assign(&mut self, other:i32)
fndiv_assign(&mut self, other:i32)
/= operation.Read more1.0.0 (const:unstable) ·Source§implFromStr fori32
implFromStr fori32
Source§fnfrom_str(src: &str) ->Result<i32,ParseIntError>
fnfrom_str(src: &str) ->Result<i32,ParseIntError>
Parses an integer from a string slice with decimal digits.
The characters are expected to be an optional+ or-sign followed by only digits. Leading and trailing non-digit characters (includingwhitespace) represent an error. Underscores (which are accepted in Rust literals)also represent an error.
§See also
For parsing numbers in other bases, such as binary or hexadecimal,seefrom_str_radix.
§Examples
Trailing space returns error:
Source§typeErr =ParseIntError
typeErr =ParseIntError
1.74.0 (const:unstable) ·Source§implMulAssign<&i32> forSaturating<i32>
implMulAssign<&i32> forSaturating<i32>
Source§fnmul_assign(&mut self, other: &i32)
fnmul_assign(&mut self, other: &i32)
*= operation.Read more1.22.0 (const:unstable) ·Source§implMulAssign<&i32> forWrapping<i32>
implMulAssign<&i32> forWrapping<i32>
Source§fnmul_assign(&mut self, other: &i32)
fnmul_assign(&mut self, other: &i32)
*= operation.Read more1.22.0 (const:unstable) ·Source§implMulAssign<&i32> fori32
implMulAssign<&i32> fori32
Source§fnmul_assign(&mut self, other: &i32)
fnmul_assign(&mut self, other: &i32)
*= operation.Read more1.74.0 (const:unstable) ·Source§implMulAssign<i32> forSaturating<i32>
implMulAssign<i32> forSaturating<i32>
Source§fnmul_assign(&mut self, other:i32)
fnmul_assign(&mut self, other:i32)
*= operation.Read more1.60.0 (const:unstable) ·Source§implMulAssign<i32> forWrapping<i32>
implMulAssign<i32> forWrapping<i32>
Source§fnmul_assign(&mut self, other:i32)
fnmul_assign(&mut self, other:i32)
*= operation.Read more1.8.0 (const:unstable) ·Source§implMulAssign fori32
implMulAssign fori32
Source§fnmul_assign(&mut self, other:i32)
fnmul_assign(&mut self, other:i32)
*= operation.Read moreSource§implNumBufferTrait fori32
implNumBufferTrait fori32
1.0.0 (const:unstable) ·Source§implOrd fori32
implOrd fori32
1.0.0 (const:unstable) ·Source§implPartialOrd fori32
implPartialOrd fori32
Source§implRangePattern fori32
implRangePattern fori32
Source§constMIN:i32 = -2_147_483_648i32
constMIN:i32 = -2_147_483_648i32
pattern_type_range_trait #123646)MIN assoc const.1.0.0 (const:unstable) ·Source§implRem fori32
This operation satisfiesn % d == n - (n / d) * d. Theresult has the same sign as the left operand.
implRem fori32
This operation satisfiesn % d == n - (n / d) * d. Theresult has the same sign as the left operand.
§Panics
This operation will panic ifother == 0 or ifself / other results in overflow.
1.74.0 (const:unstable) ·Source§implRemAssign<&i32> forSaturating<i32>
implRemAssign<&i32> forSaturating<i32>
Source§fnrem_assign(&mut self, other: &i32)
fnrem_assign(&mut self, other: &i32)
%= operation.Read more1.22.0 (const:unstable) ·Source§implRemAssign<&i32> forWrapping<i32>
implRemAssign<&i32> forWrapping<i32>
Source§fnrem_assign(&mut self, other: &i32)
fnrem_assign(&mut self, other: &i32)
%= operation.Read more1.22.0 (const:unstable) ·Source§implRemAssign<&i32> fori32
implRemAssign<&i32> fori32
Source§fnrem_assign(&mut self, other: &i32)
fnrem_assign(&mut self, other: &i32)
%= operation.Read more1.74.0 (const:unstable) ·Source§implRemAssign<i32> forSaturating<i32>
implRemAssign<i32> forSaturating<i32>
Source§fnrem_assign(&mut self, other:i32)
fnrem_assign(&mut self, other:i32)
%= operation.Read more1.60.0 (const:unstable) ·Source§implRemAssign<i32> forWrapping<i32>
implRemAssign<i32> forWrapping<i32>
Source§fnrem_assign(&mut self, other:i32)
fnrem_assign(&mut self, other:i32)
%= operation.Read more1.8.0 (const:unstable) ·Source§implRemAssign fori32
implRemAssign fori32
Source§fnrem_assign(&mut self, other:i32)
fnrem_assign(&mut self, other:i32)
%= operation.Read moreSource§impl<'lhs, const N:usize>Shl<&i32> for &'lhsSimd<i32, N>whereLaneCount<N>:SupportedLaneCount,
impl<'lhs, const N:usize>Shl<&i32> for &'lhsSimd<i32, N>whereLaneCount<N>:SupportedLaneCount,
1.22.0 (const:unstable) ·Source§implShlAssign<&i128> fori32
implShlAssign<&i128> fori32
Source§fnshl_assign(&mut self, other: &i128)
fnshl_assign(&mut self, other: &i128)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i16> fori32
implShlAssign<&i16> fori32
Source§fnshl_assign(&mut self, other: &i16)
fnshl_assign(&mut self, other: &i16)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i32> fori128
implShlAssign<&i32> fori128
Source§fnshl_assign(&mut self, other: &i32)
fnshl_assign(&mut self, other: &i32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i32> fori16
implShlAssign<&i32> fori16
Source§fnshl_assign(&mut self, other: &i32)
fnshl_assign(&mut self, other: &i32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i32> fori32
implShlAssign<&i32> fori32
Source§fnshl_assign(&mut self, other: &i32)
fnshl_assign(&mut self, other: &i32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i32> fori64
implShlAssign<&i32> fori64
Source§fnshl_assign(&mut self, other: &i32)
fnshl_assign(&mut self, other: &i32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i32> fori8
implShlAssign<&i32> fori8
Source§fnshl_assign(&mut self, other: &i32)
fnshl_assign(&mut self, other: &i32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i32> forisize
implShlAssign<&i32> forisize
Source§fnshl_assign(&mut self, other: &i32)
fnshl_assign(&mut self, other: &i32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i32> foru128
implShlAssign<&i32> foru128
Source§fnshl_assign(&mut self, other: &i32)
fnshl_assign(&mut self, other: &i32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i32> foru16
implShlAssign<&i32> foru16
Source§fnshl_assign(&mut self, other: &i32)
fnshl_assign(&mut self, other: &i32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i32> foru32
implShlAssign<&i32> foru32
Source§fnshl_assign(&mut self, other: &i32)
fnshl_assign(&mut self, other: &i32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i32> foru64
implShlAssign<&i32> foru64
Source§fnshl_assign(&mut self, other: &i32)
fnshl_assign(&mut self, other: &i32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i32> foru8
implShlAssign<&i32> foru8
Source§fnshl_assign(&mut self, other: &i32)
fnshl_assign(&mut self, other: &i32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i32> forusize
implShlAssign<&i32> forusize
Source§fnshl_assign(&mut self, other: &i32)
fnshl_assign(&mut self, other: &i32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i64> fori32
implShlAssign<&i64> fori32
Source§fnshl_assign(&mut self, other: &i64)
fnshl_assign(&mut self, other: &i64)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i8> fori32
implShlAssign<&i8> fori32
Source§fnshl_assign(&mut self, other: &i8)
fnshl_assign(&mut self, other: &i8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&isize> fori32
implShlAssign<&isize> fori32
Source§fnshl_assign(&mut self, other: &isize)
fnshl_assign(&mut self, other: &isize)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&u128> fori32
implShlAssign<&u128> fori32
Source§fnshl_assign(&mut self, other: &u128)
fnshl_assign(&mut self, other: &u128)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&u16> fori32
implShlAssign<&u16> fori32
Source§fnshl_assign(&mut self, other: &u16)
fnshl_assign(&mut self, other: &u16)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&u32> fori32
implShlAssign<&u32> fori32
Source§fnshl_assign(&mut self, other: &u32)
fnshl_assign(&mut self, other: &u32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&u64> fori32
implShlAssign<&u64> fori32
Source§fnshl_assign(&mut self, other: &u64)
fnshl_assign(&mut self, other: &u64)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&u8> fori32
implShlAssign<&u8> fori32
Source§fnshl_assign(&mut self, other: &u8)
fnshl_assign(&mut self, other: &u8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&usize> fori32
implShlAssign<&usize> fori32
Source§fnshl_assign(&mut self, other: &usize)
fnshl_assign(&mut self, other: &usize)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i128> fori32
implShlAssign<i128> fori32
Source§fnshl_assign(&mut self, other:i128)
fnshl_assign(&mut self, other:i128)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i16> fori32
implShlAssign<i16> fori32
Source§fnshl_assign(&mut self, other:i16)
fnshl_assign(&mut self, other:i16)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i32> fori128
implShlAssign<i32> fori128
Source§fnshl_assign(&mut self, other:i32)
fnshl_assign(&mut self, other:i32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i32> fori16
implShlAssign<i32> fori16
Source§fnshl_assign(&mut self, other:i32)
fnshl_assign(&mut self, other:i32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i32> fori64
implShlAssign<i32> fori64
Source§fnshl_assign(&mut self, other:i32)
fnshl_assign(&mut self, other:i32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i32> fori8
implShlAssign<i32> fori8
Source§fnshl_assign(&mut self, other:i32)
fnshl_assign(&mut self, other:i32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i32> forisize
implShlAssign<i32> forisize
Source§fnshl_assign(&mut self, other:i32)
fnshl_assign(&mut self, other:i32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i32> foru128
implShlAssign<i32> foru128
Source§fnshl_assign(&mut self, other:i32)
fnshl_assign(&mut self, other:i32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i32> foru16
implShlAssign<i32> foru16
Source§fnshl_assign(&mut self, other:i32)
fnshl_assign(&mut self, other:i32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i32> foru32
implShlAssign<i32> foru32
Source§fnshl_assign(&mut self, other:i32)
fnshl_assign(&mut self, other:i32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i32> foru64
implShlAssign<i32> foru64
Source§fnshl_assign(&mut self, other:i32)
fnshl_assign(&mut self, other:i32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i32> foru8
implShlAssign<i32> foru8
Source§fnshl_assign(&mut self, other:i32)
fnshl_assign(&mut self, other:i32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i32> forusize
implShlAssign<i32> forusize
Source§fnshl_assign(&mut self, other:i32)
fnshl_assign(&mut self, other:i32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i64> fori32
implShlAssign<i64> fori32
Source§fnshl_assign(&mut self, other:i64)
fnshl_assign(&mut self, other:i64)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i8> fori32
implShlAssign<i8> fori32
Source§fnshl_assign(&mut self, other:i8)
fnshl_assign(&mut self, other:i8)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<isize> fori32
implShlAssign<isize> fori32
Source§fnshl_assign(&mut self, other:isize)
fnshl_assign(&mut self, other:isize)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<u128> fori32
implShlAssign<u128> fori32
Source§fnshl_assign(&mut self, other:u128)
fnshl_assign(&mut self, other:u128)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<u16> fori32
implShlAssign<u16> fori32
Source§fnshl_assign(&mut self, other:u16)
fnshl_assign(&mut self, other:u16)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<u32> fori32
implShlAssign<u32> fori32
Source§fnshl_assign(&mut self, other:u32)
fnshl_assign(&mut self, other:u32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<u64> fori32
implShlAssign<u64> fori32
Source§fnshl_assign(&mut self, other:u64)
fnshl_assign(&mut self, other:u64)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<u8> fori32
implShlAssign<u8> fori32
Source§fnshl_assign(&mut self, other:u8)
fnshl_assign(&mut self, other:u8)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<usize> fori32
implShlAssign<usize> fori32
Source§fnshl_assign(&mut self, other:usize)
fnshl_assign(&mut self, other:usize)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign fori32
implShlAssign fori32
Source§fnshl_assign(&mut self, other:i32)
fnshl_assign(&mut self, other:i32)
<<= operation.Read moreSource§impl<'lhs, const N:usize>Shr<&i32> for &'lhsSimd<i32, N>whereLaneCount<N>:SupportedLaneCount,
impl<'lhs, const N:usize>Shr<&i32> for &'lhsSimd<i32, N>whereLaneCount<N>:SupportedLaneCount,
1.22.0 (const:unstable) ·Source§implShrAssign<&i128> fori32
implShrAssign<&i128> fori32
Source§fnshr_assign(&mut self, other: &i128)
fnshr_assign(&mut self, other: &i128)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i16> fori32
implShrAssign<&i16> fori32
Source§fnshr_assign(&mut self, other: &i16)
fnshr_assign(&mut self, other: &i16)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i32> fori128
implShrAssign<&i32> fori128
Source§fnshr_assign(&mut self, other: &i32)
fnshr_assign(&mut self, other: &i32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i32> fori16
implShrAssign<&i32> fori16
Source§fnshr_assign(&mut self, other: &i32)
fnshr_assign(&mut self, other: &i32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i32> fori32
implShrAssign<&i32> fori32
Source§fnshr_assign(&mut self, other: &i32)
fnshr_assign(&mut self, other: &i32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i32> fori64
implShrAssign<&i32> fori64
Source§fnshr_assign(&mut self, other: &i32)
fnshr_assign(&mut self, other: &i32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i32> fori8
implShrAssign<&i32> fori8
Source§fnshr_assign(&mut self, other: &i32)
fnshr_assign(&mut self, other: &i32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i32> forisize
implShrAssign<&i32> forisize
Source§fnshr_assign(&mut self, other: &i32)
fnshr_assign(&mut self, other: &i32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i32> foru128
implShrAssign<&i32> foru128
Source§fnshr_assign(&mut self, other: &i32)
fnshr_assign(&mut self, other: &i32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i32> foru16
implShrAssign<&i32> foru16
Source§fnshr_assign(&mut self, other: &i32)
fnshr_assign(&mut self, other: &i32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i32> foru32
implShrAssign<&i32> foru32
Source§fnshr_assign(&mut self, other: &i32)
fnshr_assign(&mut self, other: &i32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i32> foru64
implShrAssign<&i32> foru64
Source§fnshr_assign(&mut self, other: &i32)
fnshr_assign(&mut self, other: &i32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i32> foru8
implShrAssign<&i32> foru8
Source§fnshr_assign(&mut self, other: &i32)
fnshr_assign(&mut self, other: &i32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i32> forusize
implShrAssign<&i32> forusize
Source§fnshr_assign(&mut self, other: &i32)
fnshr_assign(&mut self, other: &i32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i64> fori32
implShrAssign<&i64> fori32
Source§fnshr_assign(&mut self, other: &i64)
fnshr_assign(&mut self, other: &i64)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i8> fori32
implShrAssign<&i8> fori32
Source§fnshr_assign(&mut self, other: &i8)
fnshr_assign(&mut self, other: &i8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&isize> fori32
implShrAssign<&isize> fori32
Source§fnshr_assign(&mut self, other: &isize)
fnshr_assign(&mut self, other: &isize)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&u128> fori32
implShrAssign<&u128> fori32
Source§fnshr_assign(&mut self, other: &u128)
fnshr_assign(&mut self, other: &u128)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&u16> fori32
implShrAssign<&u16> fori32
Source§fnshr_assign(&mut self, other: &u16)
fnshr_assign(&mut self, other: &u16)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&u32> fori32
implShrAssign<&u32> fori32
Source§fnshr_assign(&mut self, other: &u32)
fnshr_assign(&mut self, other: &u32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&u64> fori32
implShrAssign<&u64> fori32
Source§fnshr_assign(&mut self, other: &u64)
fnshr_assign(&mut self, other: &u64)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&u8> fori32
implShrAssign<&u8> fori32
Source§fnshr_assign(&mut self, other: &u8)
fnshr_assign(&mut self, other: &u8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&usize> fori32
implShrAssign<&usize> fori32
Source§fnshr_assign(&mut self, other: &usize)
fnshr_assign(&mut self, other: &usize)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i128> fori32
implShrAssign<i128> fori32
Source§fnshr_assign(&mut self, other:i128)
fnshr_assign(&mut self, other:i128)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i16> fori32
implShrAssign<i16> fori32
Source§fnshr_assign(&mut self, other:i16)
fnshr_assign(&mut self, other:i16)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i32> fori128
implShrAssign<i32> fori128
Source§fnshr_assign(&mut self, other:i32)
fnshr_assign(&mut self, other:i32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i32> fori16
implShrAssign<i32> fori16
Source§fnshr_assign(&mut self, other:i32)
fnshr_assign(&mut self, other:i32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i32> fori64
implShrAssign<i32> fori64
Source§fnshr_assign(&mut self, other:i32)
fnshr_assign(&mut self, other:i32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i32> fori8
implShrAssign<i32> fori8
Source§fnshr_assign(&mut self, other:i32)
fnshr_assign(&mut self, other:i32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i32> forisize
implShrAssign<i32> forisize
Source§fnshr_assign(&mut self, other:i32)
fnshr_assign(&mut self, other:i32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i32> foru128
implShrAssign<i32> foru128
Source§fnshr_assign(&mut self, other:i32)
fnshr_assign(&mut self, other:i32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i32> foru16
implShrAssign<i32> foru16
Source§fnshr_assign(&mut self, other:i32)
fnshr_assign(&mut self, other:i32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i32> foru32
implShrAssign<i32> foru32
Source§fnshr_assign(&mut self, other:i32)
fnshr_assign(&mut self, other:i32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i32> foru64
implShrAssign<i32> foru64
Source§fnshr_assign(&mut self, other:i32)
fnshr_assign(&mut self, other:i32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i32> foru8
implShrAssign<i32> foru8
Source§fnshr_assign(&mut self, other:i32)
fnshr_assign(&mut self, other:i32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i32> forusize
implShrAssign<i32> forusize
Source§fnshr_assign(&mut self, other:i32)
fnshr_assign(&mut self, other:i32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i64> fori32
implShrAssign<i64> fori32
Source§fnshr_assign(&mut self, other:i64)
fnshr_assign(&mut self, other:i64)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i8> fori32
implShrAssign<i8> fori32
Source§fnshr_assign(&mut self, other:i8)
fnshr_assign(&mut self, other:i8)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<isize> fori32
implShrAssign<isize> fori32
Source§fnshr_assign(&mut self, other:isize)
fnshr_assign(&mut self, other:isize)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<u128> fori32
implShrAssign<u128> fori32
Source§fnshr_assign(&mut self, other:u128)
fnshr_assign(&mut self, other:u128)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<u16> fori32
implShrAssign<u16> fori32
Source§fnshr_assign(&mut self, other:u16)
fnshr_assign(&mut self, other:u16)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<u32> fori32
implShrAssign<u32> fori32
Source§fnshr_assign(&mut self, other:u32)
fnshr_assign(&mut self, other:u32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<u64> fori32
implShrAssign<u64> fori32
Source§fnshr_assign(&mut self, other:u64)
fnshr_assign(&mut self, other:u64)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<u8> fori32
implShrAssign<u8> fori32
Source§fnshr_assign(&mut self, other:u8)
fnshr_assign(&mut self, other:u8)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<usize> fori32
implShrAssign<usize> fori32
Source§fnshr_assign(&mut self, other:usize)
fnshr_assign(&mut self, other:usize)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign fori32
implShrAssign fori32
Source§fnshr_assign(&mut self, other:i32)
fnshr_assign(&mut self, other:i32)
>>= operation.Read moreSource§implSimdElement fori32
implSimdElement fori32
Source§implStep fori32
implStep fori32
Source§fnforward(start:i32, n:usize) ->i32
fnforward(start:i32, n:usize) ->i32
step_trait #42168)Source§fnbackward(start:i32, n:usize) ->i32
fnbackward(start:i32, n:usize) ->i32
step_trait #42168)Source§unsafe fnforward_unchecked(start:i32, n:usize) ->i32
unsafe fnforward_unchecked(start:i32, n:usize) ->i32
step_trait #42168)Source§unsafe fnbackward_unchecked(start:i32, n:usize) ->i32
unsafe fnbackward_unchecked(start:i32, n:usize) ->i32
step_trait #42168)Source§fnsteps_between(start: &i32, end: &i32) -> (usize,Option<usize>)
fnsteps_between(start: &i32, end: &i32) -> (usize,Option<usize>)
step_trait #42168)start toendlikeIterator::size_hint().Read more1.74.0 (const:unstable) ·Source§implSubAssign<&i32> forSaturating<i32>
implSubAssign<&i32> forSaturating<i32>
Source§fnsub_assign(&mut self, other: &i32)
fnsub_assign(&mut self, other: &i32)
-= operation.Read more1.22.0 (const:unstable) ·Source§implSubAssign<&i32> forWrapping<i32>
implSubAssign<&i32> forWrapping<i32>
Source§fnsub_assign(&mut self, other: &i32)
fnsub_assign(&mut self, other: &i32)
-= operation.Read more1.22.0 (const:unstable) ·Source§implSubAssign<&i32> fori32
implSubAssign<&i32> fori32
Source§fnsub_assign(&mut self, other: &i32)
fnsub_assign(&mut self, other: &i32)
-= operation.Read more1.74.0 (const:unstable) ·Source§implSubAssign<i32> forSaturating<i32>
implSubAssign<i32> forSaturating<i32>
Source§fnsub_assign(&mut self, other:i32)
fnsub_assign(&mut self, other:i32)
-= operation.Read more1.60.0 (const:unstable) ·Source§implSubAssign<i32> forWrapping<i32>
implSubAssign<i32> forWrapping<i32>
Source§fnsub_assign(&mut self, other:i32)
fnsub_assign(&mut self, other:i32)
-= operation.Read more1.8.0 (const:unstable) ·Source§implSubAssign fori32
implSubAssign fori32
Source§fnsub_assign(&mut self, other:i32)
fnsub_assign(&mut self, other:i32)
-= operation.Read more1.34.0 (const:unstable) ·Source§implTryFrom<i128> fori32
implTryFrom<i128> fori32
Source§fntry_from(u:i128) ->Result<i32, <i32 asTryFrom<i128>>::Error>
fntry_from(u:i128) ->Result<i32, <i32 asTryFrom<i128>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<i32> fori16
implTryFrom<i32> fori16
Source§fntry_from(u:i32) ->Result<i16, <i16 asTryFrom<i32>>::Error>
fntry_from(u:i32) ->Result<i16, <i16 asTryFrom<i32>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<i32> fori8
implTryFrom<i32> fori8
Source§fntry_from(u:i32) ->Result<i8, <i8 asTryFrom<i32>>::Error>
fntry_from(u:i32) ->Result<i8, <i8 asTryFrom<i32>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<i32> forisize
implTryFrom<i32> forisize
Source§fntry_from(value:i32) ->Result<isize, <isize asTryFrom<i32>>::Error>
fntry_from(value:i32) ->Result<isize, <isize asTryFrom<i32>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<i32> foru128
implTryFrom<i32> foru128
Source§fntry_from(u:i32) ->Result<u128, <u128 asTryFrom<i32>>::Error>
fntry_from(u:i32) ->Result<u128, <u128 asTryFrom<i32>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<i32> foru16
implTryFrom<i32> foru16
Source§fntry_from(u:i32) ->Result<u16, <u16 asTryFrom<i32>>::Error>
fntry_from(u:i32) ->Result<u16, <u16 asTryFrom<i32>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<i32> foru32
implTryFrom<i32> foru32
Source§fntry_from(u:i32) ->Result<u32, <u32 asTryFrom<i32>>::Error>
fntry_from(u:i32) ->Result<u32, <u32 asTryFrom<i32>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<i32> foru64
implTryFrom<i32> foru64
Source§fntry_from(u:i32) ->Result<u64, <u64 asTryFrom<i32>>::Error>
fntry_from(u:i32) ->Result<u64, <u64 asTryFrom<i32>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<i32> foru8
implTryFrom<i32> foru8
Source§fntry_from(u:i32) ->Result<u8, <u8 asTryFrom<i32>>::Error>
fntry_from(u:i32) ->Result<u8, <u8 asTryFrom<i32>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<i32> forusize
implTryFrom<i32> forusize
Source§fntry_from(u:i32) ->Result<usize, <usize asTryFrom<i32>>::Error>
fntry_from(u:i32) ->Result<usize, <usize asTryFrom<i32>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<i64> fori32
implTryFrom<i64> fori32
Source§fntry_from(u:i64) ->Result<i32, <i32 asTryFrom<i64>>::Error>
fntry_from(u:i64) ->Result<i32, <i32 asTryFrom<i64>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<isize> fori32
implTryFrom<isize> fori32
Source§fntry_from(u:isize) ->Result<i32, <i32 asTryFrom<isize>>::Error>
fntry_from(u:isize) ->Result<i32, <i32 asTryFrom<isize>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<u128> fori32
implTryFrom<u128> fori32
Source§fntry_from(u:u128) ->Result<i32, <i32 asTryFrom<u128>>::Error>
fntry_from(u:u128) ->Result<i32, <i32 asTryFrom<u128>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<u32> fori32
implTryFrom<u32> fori32
Source§fntry_from(u:u32) ->Result<i32, <i32 asTryFrom<u32>>::Error>
fntry_from(u:u32) ->Result<i32, <i32 asTryFrom<u32>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<u64> fori32
implTryFrom<u64> fori32
Source§fntry_from(u:u64) ->Result<i32, <i32 asTryFrom<u64>>::Error>
fntry_from(u:u64) ->Result<i32, <i32 asTryFrom<u64>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.
Source§typeError =TryFromIntError
typeError =TryFromIntError
1.34.0 (const:unstable) ·Source§implTryFrom<usize> fori32
implTryFrom<usize> fori32
Source§fntry_from(u:usize) ->Result<i32, <i32 asTryFrom<usize>>::Error>
fntry_from(u:usize) ->Result<i32, <i32 asTryFrom<usize>>::Error>
Tries to create the target number type from a sourcenumber type. This returns an error if the source valueis outside of the range of the target type.