Primitive Typei8
Expand description
The 8-bit signed integer type.
Implementations§
Source§impli8
impli8
1.43.0 ·Sourcepub constMIN:i8
pub constMIN:i8
The smallest value that can be represented by this integer type(−27).
§Examples
1.43.0 ·Sourcepub constMAX:i8
pub constMAX:i8
The largest value that can be represented by this integer type(27 − 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) ->i8
🔬This is a nightly-only experimental API. (isolate_most_least_significant_one #136909)
pub const fnisolate_highest_one(self) ->i8
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) ->i8
🔬This is a nightly-only experimental API. (isolate_most_least_significant_one #136909)
pub const fnisolate_lowest_one(self) ->i8
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) ->u8
pub const fncast_unsigned(self) ->u8
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) ->i8
pub const fnrotate_left(self, n:u32) ->i8
Shifts the bits to the left by a specified amount,n,wrapping the truncated bits to the end of the resulting integer.
rotate_left(n) is equivalent to applyingrotate_left(1) a total ofn times. Inparticular, a rotation by the number of bits inself returns the input valueunchanged.
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) ->i8
pub const fnrotate_right(self, n:u32) ->i8
Shifts the bits to the right by a specified amount,n,wrapping the truncated bits to the beginning of the resultinginteger.
rotate_right(n) is equivalent to applyingrotate_right(1) a total ofn times. Inparticular, a rotation by the number of bits inself returns the input valueunchanged.
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) ->i8
pub const fnswap_bytes(self) ->i8
Reverses the byte order of the integer.
§Examples
1.37.0 (const: 1.37.0) ·Sourcepub const fnreverse_bits(self) ->i8
pub const fnreverse_bits(self) ->i8
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:i8) ->i8
pub const fnfrom_be(x:i8) ->i8
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.
See alsofrom_be_bytes().
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnfrom_le(x:i8) ->i8
pub const fnfrom_le(x:i8) ->i8
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.
See alsofrom_le_bytes().
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnto_be(self) ->i8
pub const fnto_be(self) ->i8
Swaps bytes ofself on little endian targets.
On big endian this is a no-op.
The returned value has the same type asself, and will be interpretedas (a potentially different) value of a native-endiani8.
Seeto_be_bytes() for a type-safe alternative.
§Examples
1.0.0 (const: 1.32.0) ·Sourcepub const fnto_le(self) ->i8
pub const fnto_le(self) ->i8
Swaps bytes ofself on big endian targets.
On little endian this is a no-op.
The returned value has the same type asself, and will be interpretedas (a potentially different) value of a native-endiani8.
Seeto_le_bytes() for a type-safe alternative.
§Examples
1.0.0 (const: 1.47.0) ·Sourcepub const fnchecked_add(self, rhs:i8) ->Option<i8>
pub const fnchecked_add(self, rhs:i8) ->Option<i8>
Checked integer addition. Computesself + rhs, returningNoneif overflow occurred.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_add(self, rhs:i8) ->i8
pub const fnstrict_add(self, rhs:i8) ->i8
1.79.0 (const: 1.79.0) ·Sourcepub const unsafe fnunchecked_add(self, rhs:i8) ->i8
pub const unsafe fnunchecked_add(self, rhs:i8) ->i8
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 > i8::MAX orself + rhs < i8::MIN,i.e. whenchecked_add would returnNone.
1.66.0 (const: 1.66.0) ·Sourcepub const fnchecked_add_unsigned(self, rhs:u8) ->Option<i8>
pub const fnchecked_add_unsigned(self, rhs:u8) ->Option<i8>
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:u8) ->i8
pub const fnstrict_add_unsigned(self, rhs:u8) ->i8
1.0.0 (const: 1.47.0) ·Sourcepub const fnchecked_sub(self, rhs:i8) ->Option<i8>
pub const fnchecked_sub(self, rhs:i8) ->Option<i8>
Checked integer subtraction. Computesself - rhs, returningNone ifoverflow occurred.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_sub(self, rhs:i8) ->i8
pub const fnstrict_sub(self, rhs:i8) ->i8
1.79.0 (const: 1.79.0) ·Sourcepub const unsafe fnunchecked_sub(self, rhs:i8) ->i8
pub const unsafe fnunchecked_sub(self, rhs:i8) ->i8
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 > i8::MAX orself - rhs < i8::MIN,i.e. whenchecked_sub would returnNone.
1.66.0 (const: 1.66.0) ·Sourcepub const fnchecked_sub_unsigned(self, rhs:u8) ->Option<i8>
pub const fnchecked_sub_unsigned(self, rhs:u8) ->Option<i8>
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:u8) ->i8
pub const fnstrict_sub_unsigned(self, rhs:u8) ->i8
1.0.0 (const: 1.47.0) ·Sourcepub const fnchecked_mul(self, rhs:i8) ->Option<i8>
pub const fnchecked_mul(self, rhs:i8) ->Option<i8>
Checked integer multiplication. Computesself * rhs, returningNone ifoverflow occurred.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_mul(self, rhs:i8) ->i8
pub const fnstrict_mul(self, rhs:i8) ->i8
1.79.0 (const: 1.79.0) ·Sourcepub const unsafe fnunchecked_mul(self, rhs:i8) ->i8
pub const unsafe fnunchecked_mul(self, rhs:i8) ->i8
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 > i8::MAX orself * rhs < i8::MIN,i.e. whenchecked_mul would returnNone.
1.0.0 (const: 1.52.0) ·Sourcepub const fnchecked_div(self, rhs:i8) ->Option<i8>
pub const fnchecked_div(self, rhs:i8) ->Option<i8>
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:i8) ->i8
pub const fnstrict_div(self, rhs:i8) ->i8
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:i8) ->Option<i8>
pub const fnchecked_div_euclid(self, rhs:i8) ->Option<i8>
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:i8) ->i8
pub const fnstrict_div_euclid(self, rhs:i8) ->i8
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_div_exact(self, rhs:i8) ->Option<i8>
🔬This is a nightly-only experimental API. (exact_div #139911)
pub const fnchecked_div_exact(self, rhs:i8) ->Option<i8>
exact_div #139911)Checked integer division without remainder. Computesself / rhs,returningNone ifrhs == 0, the division results in overflow,orself % rhs != 0.
§Examples
Sourcepub const fndiv_exact(self, rhs:i8) ->Option<i8>
🔬This is a nightly-only experimental API. (exact_div #139911)
pub const fndiv_exact(self, rhs:i8) ->Option<i8>
exact_div #139911)Integer division without remainder. Computesself / rhs, returningNone ifself % rhs != 0.
§Panics
This function will panic ifrhs == 0.
§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
Sourcepub const unsafe fnunchecked_div_exact(self, rhs:i8) ->i8
🔬This is a nightly-only experimental API. (exact_div #139911)
pub const unsafe fnunchecked_div_exact(self, rhs:i8) ->i8
exact_div #139911)Unchecked integer division without remainder. Computesself / rhs.
§Safety
This results in undefined behavior whenrhs == 0,self % rhs != 0, orself == i8::MIN && rhs == -1,i.e. whenchecked_div_exact would returnNone.
1.7.0 (const: 1.52.0) ·Sourcepub const fnchecked_rem(self, rhs:i8) ->Option<i8>
pub const fnchecked_rem(self, rhs:i8) ->Option<i8>
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:i8) ->i8
pub const fnstrict_rem(self, rhs:i8) ->i8
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:i8) ->Option<i8>
pub const fnchecked_rem_euclid(self, rhs:i8) ->Option<i8>
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:i8) ->i8
pub const fnstrict_rem_euclid(self, rhs:i8) ->i8
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<i8>
pub const fnchecked_neg(self) ->Option<i8>
Checked negation. Computes-self, returningNone ifself == MIN.
§Examples
1.93.0 (const: 1.93.0) ·Sourcepub const unsafe fnunchecked_neg(self) ->i8
pub const unsafe fnunchecked_neg(self) ->i8
Unchecked negation. Computes-self, assuming overflow cannot occur.
§Safety
This results in undefined behavior whenself == i8::MIN,i.e. whenchecked_neg would returnNone.
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_neg(self) ->i8
pub const fnstrict_neg(self) ->i8
1.7.0 (const: 1.47.0) ·Sourcepub const fnchecked_shl(self, rhs:u32) ->Option<i8>
pub const fnchecked_shl(self, rhs:u32) ->Option<i8>
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) ->i8
pub const fnstrict_shl(self, rhs:u32) ->i8
1.93.0 (const: 1.93.0) ·Sourcepub const unsafe fnunchecked_shl(self, rhs:u32) ->i8
pub const unsafe fnunchecked_shl(self, rhs:u32) ->i8
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) ->i8
pub const fnunbounded_shl(self, rhs:u32) ->i8
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 fnshl_exact(self, rhs:u32) ->Option<i8>
🔬This is a nightly-only experimental API. (exact_bitshifts #144336)
pub const fnshl_exact(self, rhs:u32) ->Option<i8>
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 >=i8::BITS.Otherwise, returnsSome(self << rhs).
§Examples
Sourcepub const unsafe fnunchecked_shl_exact(self, rhs:u32) ->i8
🔬This is a nightly-only experimental API. (exact_bitshifts #144336)
pub const unsafe fnunchecked_shl_exact(self, rhs:u32) ->i8
exact_bitshifts #144336)Unchecked exact shift left. Computesself << rhs, assuming the operation can belosslessly reversed andrhs cannot be larger thani8::BITS.
§Safety
This results in undefined behavior whenrhs >= self.leading_zeros() && rhs >= self.leading_ones() i.e. wheni8::shl_exactwould returnNone.
1.7.0 (const: 1.47.0) ·Sourcepub const fnchecked_shr(self, rhs:u32) ->Option<i8>
pub const fnchecked_shr(self, rhs:u32) ->Option<i8>
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) ->i8
pub const fnstrict_shr(self, rhs:u32) ->i8
1.93.0 (const: 1.93.0) ·Sourcepub const unsafe fnunchecked_shr(self, rhs:u32) ->i8
pub const unsafe fnunchecked_shr(self, rhs:u32) ->i8
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) ->i8
pub const fnunbounded_shr(self, rhs:u32) ->i8
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 fnshr_exact(self, rhs:u32) ->Option<i8>
🔬This is a nightly-only experimental API. (exact_bitshifts #144336)
pub const fnshr_exact(self, rhs:u32) ->Option<i8>
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 >=i8::BITS.Otherwise, returnsSome(self >> rhs).
§Examples
Sourcepub const unsafe fnunchecked_shr_exact(self, rhs:u32) ->i8
🔬This is a nightly-only experimental API. (exact_bitshifts #144336)
pub const unsafe fnunchecked_shr_exact(self, rhs:u32) ->i8
exact_bitshifts #144336)Unchecked exact shift right. Computesself >> rhs, assuming the operation can belosslessly reversed andrhs cannot be larger thani8::BITS.
§Safety
This results in undefined behavior whenrhs > self.trailing_zeros() || rhs >= i8::BITSi.e. wheni8::shr_exactwould returnNone.
1.13.0 (const: 1.47.0) ·Sourcepub const fnchecked_abs(self) ->Option<i8>
pub const fnchecked_abs(self) ->Option<i8>
Checked absolute value. Computesself.abs(), returningNone ifself == MIN.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_abs(self) ->i8
pub const fnstrict_abs(self) ->i8
1.34.0 (const: 1.50.0) ·Sourcepub const fnchecked_pow(self, exp:u32) ->Option<i8>
pub const fnchecked_pow(self, exp:u32) ->Option<i8>
Checked exponentiation. Computesself.pow(exp), returningNone ifoverflow occurred.
§Examples
1.91.0 (const: 1.91.0) ·Sourcepub const fnstrict_pow(self, exp:u32) ->i8
pub const fnstrict_pow(self, exp:u32) ->i8
1.84.0 (const: 1.84.0) ·Sourcepub const fnchecked_isqrt(self) ->Option<i8>
pub const fnchecked_isqrt(self) ->Option<i8>
1.0.0 (const: 1.47.0) ·Sourcepub const fnsaturating_add(self, rhs:i8) ->i8
pub const fnsaturating_add(self, rhs:i8) ->i8
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:u8) ->i8
pub const fnsaturating_add_unsigned(self, rhs:u8) ->i8
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:i8) ->i8
pub const fnsaturating_sub(self, rhs:i8) ->i8
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:u8) ->i8
pub const fnsaturating_sub_unsigned(self, rhs:u8) ->i8
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) ->i8
pub const fnsaturating_neg(self) ->i8
Saturating integer negation. Computes-self, returningMAX ifself == MINinstead of overflowing.
§Examples
1.45.0 (const: 1.47.0) ·Sourcepub const fnsaturating_abs(self) ->i8
pub const fnsaturating_abs(self) ->i8
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:i8) ->i8
pub const fnsaturating_mul(self, rhs:i8) ->i8
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:i8) ->i8
pub const fnsaturating_div(self, rhs:i8) ->i8
1.34.0 (const: 1.50.0) ·Sourcepub const fnsaturating_pow(self, exp:u32) ->i8
pub const fnsaturating_pow(self, exp:u32) ->i8
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:i8) ->i8
pub const fnwrapping_add(self, rhs:i8) ->i8
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:u8) ->i8
pub const fnwrapping_add_unsigned(self, rhs:u8) ->i8
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:i8) ->i8
pub const fnwrapping_sub(self, rhs:i8) ->i8
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:u8) ->i8
pub const fnwrapping_sub_unsigned(self, rhs:u8) ->i8
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:i8) ->i8
pub const fnwrapping_mul(self, rhs:i8) ->i8
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:i8) ->i8
pub const fnwrapping_div(self, rhs:i8) ->i8
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:i8) ->i8
pub const fnwrapping_div_euclid(self, rhs:i8) ->i8
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:i8) ->i8
pub const fnwrapping_rem(self, rhs:i8) ->i8
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:i8) ->i8
pub const fnwrapping_rem_euclid(self, rhs:i8) ->i8
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) ->i8
pub const fnwrapping_neg(self) ->i8
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) ->i8
pub const fnwrapping_shl(self, rhs:u32) ->i8
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) ->i8
pub const fnwrapping_shr(self, rhs:u32) ->i8
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) ->i8
pub const fnwrapping_abs(self) ->i8
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) ->u8
pub const fnunsigned_abs(self) ->u8
Computes the absolute value ofself without any wrappingor panicking.
§Examples
1.34.0 (const: 1.50.0) ·Sourcepub const fnwrapping_pow(self, exp:u32) ->i8
pub const fnwrapping_pow(self, exp:u32) ->i8
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:i8) -> (i8,bool)
pub const fnoverflowing_add(self, rhs:i8) -> (i8,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:i8, carry:bool) -> (i8,bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods #85532)
pub const fncarrying_add(self, rhs:i8, carry:bool) -> (i8,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 methodu8::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^8 + 2^8 - 1)// + -5 9 (b = -5 × 2^8 + 9)// ---------// 6 8 (sum = 6 × 2^8 + 8)let(a1, a0): (i8, u8) = (10, u8::MAX);let(b1, b0): (i8, u8) = (-5,9);letcarry0 =false;// u8::carrying_add for the less significant wordslet(sum0, carry1) = a0.carrying_add(b0, carry0);assert_eq!(carry1,true);// i8::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:u8) -> (i8,bool)
pub const fnoverflowing_add_unsigned(self, rhs:u8) -> (i8,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:i8) -> (i8,bool)
pub const fnoverflowing_sub(self, rhs:i8) -> (i8,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:i8, borrow:bool) -> (i8,bool)
🔬This is a nightly-only experimental API. (bigint_helper_methods #85532)
pub const fnborrowing_sub(self, rhs:i8, borrow:bool) -> (i8,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 methodu8::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^8 + 8)// - -5 9 (b = -5 × 2^8 + 9)// ---------// 10 MAX (diff = 10 × 2^8 + 2^8 - 1)let(a1, a0): (i8, u8) = (6,8);let(b1, b0): (i8, u8) = (-5,9);letborrow0 =false;// u8::borrowing_sub for the less significant wordslet(diff0, borrow1) = a0.borrowing_sub(b0, borrow0);assert_eq!(borrow1,true);// i8::borrowing_sub for the most significant wordlet(diff1, overflow) = a1.borrowing_sub(b1, borrow1);assert_eq!(overflow,false);assert_eq!((diff1, diff0), (10, u8::MAX));1.66.0 (const: 1.66.0) ·Sourcepub const fnoverflowing_sub_unsigned(self, rhs:u8) -> (i8,bool)
pub const fnoverflowing_sub_unsigned(self, rhs:u8) -> (i8,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:i8) -> (i8,bool)
pub const fnoverflowing_mul(self, rhs:i8) -> (i8,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:i8) -> (u8,i8)
🔬This is a nightly-only experimental API. (bigint_helper_methods #85532)
pub const fnwidening_mul(self, rhs:i8) -> (u8,i8)
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:i8, carry:i8) -> (u8,i8)
🔬This is a nightly-only experimental API. (bigint_helper_methods #85532)
pub const fncarrying_mul(self, rhs:i8, carry:i8) -> (u8,i8)
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!(i8::MAX.carrying_mul(i8::MAX, i8::MAX), (i8::MAX.unsigned_abs() +1, i8::MAX /2));Sourcepub const fncarrying_mul_add(self, rhs:i8, carry:i8, add:i8) -> (u8,i8)
🔬This is a nightly-only experimental API. (bigint_helper_methods #85532)
pub const fncarrying_mul_add(self, rhs:i8, carry:i8, add:i8) -> (u8,i8)
bigint_helper_methods #85532)Calculates the “full multiplication”self * rhs + carry + addwithout 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!(i8::MAX.carrying_mul_add(i8::MAX, i8::MAX, i8::MAX), (u8::MAX, i8::MAX /2));1.7.0 (const: 1.52.0) ·Sourcepub const fnoverflowing_div(self, rhs:i8) -> (i8,bool)
pub const fnoverflowing_div(self, rhs:i8) -> (i8,bool)
1.38.0 (const: 1.52.0) ·Sourcepub const fnoverflowing_div_euclid(self, rhs:i8) -> (i8,bool)
pub const fnoverflowing_div_euclid(self, rhs:i8) -> (i8,bool)
1.7.0 (const: 1.52.0) ·Sourcepub const fnoverflowing_rem(self, rhs:i8) -> (i8,bool)
pub const fnoverflowing_rem(self, rhs:i8) -> (i8,bool)
1.38.0 (const: 1.52.0) ·Sourcepub const fnoverflowing_rem_euclid(self, rhs:i8) -> (i8,bool)
pub const fnoverflowing_rem_euclid(self, rhs:i8) -> (i8,bool)
1.7.0 (const: 1.32.0) ·Sourcepub const fnoverflowing_neg(self) -> (i8,bool)
pub const fnoverflowing_neg(self) -> (i8,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) -> (i8,bool)
pub const fnoverflowing_shl(self, rhs:u32) -> (i8,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) -> (i8,bool)
pub const fnoverflowing_shr(self, rhs:u32) -> (i8,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) -> (i8,bool)
pub const fnoverflowing_abs(self) -> (i8,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., i8::MIN for values of type i8),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) -> (i8,bool)
pub const fnoverflowing_pow(self, exp:u32) -> (i8,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) ->i8
pub const fnpow(self, exp:u32) ->i8
Raises self to the power ofexp, using exponentiation by squaring.
§Examples
1.38.0 (const: 1.52.0) ·Sourcepub const fndiv_euclid(self, rhs:i8) ->i8
pub const fndiv_euclid(self, rhs:i8) ->i8
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:i8) ->i8
pub const fnrem_euclid(self, rhs:i8) ->i8
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: i8 =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:i8) ->i8
🔬This is a nightly-only experimental API. (int_roundings #88581)
pub const fndiv_floor(self, rhs:i8) ->i8
int_roundings #88581)Sourcepub const fndiv_ceil(self, rhs:i8) ->i8
🔬This is a nightly-only experimental API. (int_roundings #88581)
pub const fndiv_ceil(self, rhs:i8) ->i8
int_roundings #88581)Sourcepub const fnnext_multiple_of(self, rhs:i8) ->i8
🔬This is a nightly-only experimental API. (int_roundings #88581)
pub const fnnext_multiple_of(self, rhs:i8) ->i8
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_i8.next_multiple_of(8),16);assert_eq!(23_i8.next_multiple_of(8),24);assert_eq!(16_i8.next_multiple_of(-8),16);assert_eq!(23_i8.next_multiple_of(-8),16);assert_eq!((-16_i8).next_multiple_of(8), -16);assert_eq!((-23_i8).next_multiple_of(8), -16);assert_eq!((-16_i8).next_multiple_of(-8), -16);assert_eq!((-23_i8).next_multiple_of(-8), -24);Sourcepub const fnchecked_next_multiple_of(self, rhs:i8) ->Option<i8>
🔬This is a nightly-only experimental API. (int_roundings #88581)
pub const fnchecked_next_multiple_of(self, rhs:i8) ->Option<i8>
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_i8.checked_next_multiple_of(8),Some(16));assert_eq!(23_i8.checked_next_multiple_of(8),Some(24));assert_eq!(16_i8.checked_next_multiple_of(-8),Some(16));assert_eq!(23_i8.checked_next_multiple_of(-8),Some(16));assert_eq!((-16_i8).checked_next_multiple_of(8),Some(-16));assert_eq!((-23_i8).checked_next_multiple_of(8),Some(-16));assert_eq!((-16_i8).checked_next_multiple_of(-8),Some(-16));assert_eq!((-23_i8).checked_next_multiple_of(-8),Some(-24));assert_eq!(1_i8.checked_next_multiple_of(0),None);assert_eq!(i8::MAX.checked_next_multiple_of(2),None);1.67.0 (const: 1.67.0) ·Sourcepub const fnilog(self, base:i8) ->u32
pub const fnilog(self, base:i8) ->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:i8) ->Option<u32>
pub const fnchecked_ilog(self, base:i8) ->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) ->i8
pub const fnabs(self) ->i8
Computes the absolute value ofself.
§Overflow behavior
The absolute value ofi8::MINcannot be represented as ani8,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 returni8::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:i8) ->u8
pub const fnabs_diff(self, other:i8) ->u8
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) ->i8
pub const fnsignum(self) ->i8
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;1]
pub const fnto_be_bytes(self) -> [u8;1]
Returns the memory representation of this integer as a byte array inbig-endian (network) byte order.
Note: This function is meaningless oni8. Byte order does not exist as aconcept for byte-sized integers. This function is only provided in symmetrywith larger integer types. You can cast from and tou8 usingcast_signed andcast_unsigned.
§Examples
1.32.0 (const: 1.44.0) ·Sourcepub const fnto_le_bytes(self) -> [u8;1]
pub const fnto_le_bytes(self) -> [u8;1]
Returns the memory representation of this integer as a byte array inlittle-endian byte order.
Note: This function is meaningless oni8. Byte order does not exist as aconcept for byte-sized integers. This function is only provided in symmetrywith larger integer types. You can cast from and tou8 usingcast_signed andcast_unsigned.
§Examples
1.32.0 (const: 1.44.0) ·Sourcepub const fnto_ne_bytes(self) -> [u8;1]
pub const fnto_ne_bytes(self) -> [u8;1]
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.
Note: This function is meaningless oni8. Byte order does not exist as aconcept for byte-sized integers. This function is only provided in symmetrywith larger integer types. You can cast from and tou8 usingcast_signed andcast_unsigned.
§Examples
1.32.0 (const: 1.44.0) ·Sourcepub const fnfrom_be_bytes(bytes: [u8;1]) ->i8
pub const fnfrom_be_bytes(bytes: [u8;1]) ->i8
Creates an integer value from its representation as a byte array inbig endian.
Note: This function is meaningless oni8. Byte order does not exist as aconcept for byte-sized integers. This function is only provided in symmetrywith larger integer types. You can cast from and tou8 usingcast_signed andcast_unsigned.
§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;1]) ->i8
pub const fnfrom_le_bytes(bytes: [u8;1]) ->i8
Creates an integer value from its representation as a byte array inlittle endian.
Note: This function is meaningless oni8. Byte order does not exist as aconcept for byte-sized integers. This function is only provided in symmetrywith larger integer types. You can cast from and tou8 usingcast_signed andcast_unsigned.
§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;1]) ->i8
pub const fnfrom_ne_bytes(bytes: [u8;1]) ->i8
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.
Note: This function is meaningless oni8. Byte order does not exist as aconcept for byte-sized integers. This function is only provided in symmetrywith larger integer types. You can cast from and tou8 usingcast_signed andcast_unsigned.
§Examples
letvalue = i8::from_ne_bytes(ifcfg!(target_endian ="big") { [0x12]}else{ [0x12]});assert_eq!(value,0x12);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() ->i8
👎Deprecating in a future version: replaced by theMIN associated constant on this type
pub const fnmin_value() ->i8
MIN associated constant on this typeNew code should prefer to usei8::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() ->i8
👎Deprecating in a future version: replaced by theMAX associated constant on this type
pub const fnmax_value() ->i8
MAX associated constant on this typeNew code should prefer to usei8::MAX instead.
Returns the largest value that can be represented by this integer type.
Sourcepub fnclamp_magnitude(self, limit:u8) ->i8
🔬This is a nightly-only experimental API. (clamp_magnitude #148519)
pub fnclamp_magnitude(self, limit:u8) ->i8
clamp_magnitude #148519)Clamps this number to a symmetric range centred around zero.
The method clamps the number’s magnitude (absolute value) to be at mostlimit.
This is functionally equivalent toself.clamp(-limit, limit), but is moreexplicit about the intent.
§Examples
1.87.0 (const: 1.87.0) ·Sourcepub const fnmidpoint(self, rhs:i8) ->i8
pub const fnmidpoint(self, rhs:i8) ->i8
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§impli8
impli8
1.0.0 (const: 1.82.0) ·Sourcepub const fnfrom_str_radix(src: &str, radix:u32) ->Result<i8,ParseIntError>
pub const fnfrom_str_radix(src: &str, radix:u32) ->Result<i8,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<i8,ParseIntError>
🔬This is a nightly-only experimental API. (int_from_ascii #134821)
pub const fnfrom_ascii(src: &[u8]) ->Result<i8,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<i8,ParseIntError>
🔬This is a nightly-only experimental API. (int_from_ascii #134821)
pub const fnfrom_ascii_radix( src: &[u8], radix:u32,) ->Result<i8,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<&i8> forSaturating<i8>
implAddAssign<&i8> forSaturating<i8>
Source§fnadd_assign(&mut self, other: &i8)
fnadd_assign(&mut self, other: &i8)
+= operation.Read more1.22.0 (const:unstable) ·Source§implAddAssign<&i8> forWrapping<i8>
implAddAssign<&i8> forWrapping<i8>
Source§fnadd_assign(&mut self, other: &i8)
fnadd_assign(&mut self, other: &i8)
+= operation.Read more1.22.0 (const:unstable) ·Source§implAddAssign<&i8> fori8
implAddAssign<&i8> fori8
Source§fnadd_assign(&mut self, other: &i8)
fnadd_assign(&mut self, other: &i8)
+= operation.Read more1.74.0 (const:unstable) ·Source§implAddAssign<i8> forSaturating<i8>
implAddAssign<i8> forSaturating<i8>
Source§fnadd_assign(&mut self, other:i8)
fnadd_assign(&mut self, other:i8)
+= operation.Read more1.60.0 (const:unstable) ·Source§implAddAssign<i8> forWrapping<i8>
implAddAssign<i8> forWrapping<i8>
Source§fnadd_assign(&mut self, other:i8)
fnadd_assign(&mut self, other:i8)
+= operation.Read more1.8.0 (const:unstable) ·Source§implAddAssign fori8
implAddAssign fori8
Source§fnadd_assign(&mut self, other:i8)
fnadd_assign(&mut self, other:i8)
+= operation.Read moreSource§implAtomicPrimitive fori8
Available ontarget_has_atomic_load_store=8 only.
implAtomicPrimitive fori8
target_has_atomic_load_store=8 only.Source§typeAtomicInner =AtomicI8
typeAtomicInner =AtomicI8
atomic_internals)1.74.0 (const:unstable) ·Source§implBitAndAssign<&i8> forSaturating<i8>
implBitAndAssign<&i8> forSaturating<i8>
Source§fnbitand_assign(&mut self, other: &i8)
fnbitand_assign(&mut self, other: &i8)
&= operation.Read more1.22.0 (const:unstable) ·Source§implBitAndAssign<&i8> forWrapping<i8>
implBitAndAssign<&i8> forWrapping<i8>
Source§fnbitand_assign(&mut self, other: &i8)
fnbitand_assign(&mut self, other: &i8)
&= operation.Read more1.22.0 (const:unstable) ·Source§implBitAndAssign<&i8> fori8
implBitAndAssign<&i8> fori8
Source§fnbitand_assign(&mut self, other: &i8)
fnbitand_assign(&mut self, other: &i8)
&= operation.Read more1.74.0 (const:unstable) ·Source§implBitAndAssign<i8> forSaturating<i8>
implBitAndAssign<i8> forSaturating<i8>
Source§fnbitand_assign(&mut self, other:i8)
fnbitand_assign(&mut self, other:i8)
&= operation.Read more1.60.0 (const:unstable) ·Source§implBitAndAssign<i8> forWrapping<i8>
implBitAndAssign<i8> forWrapping<i8>
Source§fnbitand_assign(&mut self, other:i8)
fnbitand_assign(&mut self, other:i8)
&= operation.Read more1.8.0 (const:unstable) ·Source§implBitAndAssign fori8
implBitAndAssign fori8
Source§fnbitand_assign(&mut self, other:i8)
fnbitand_assign(&mut self, other:i8)
&= operation.Read more1.74.0 (const:unstable) ·Source§implBitOrAssign<&i8> forSaturating<i8>
implBitOrAssign<&i8> forSaturating<i8>
Source§fnbitor_assign(&mut self, other: &i8)
fnbitor_assign(&mut self, other: &i8)
|= operation.Read more1.22.0 (const:unstable) ·Source§implBitOrAssign<&i8> forWrapping<i8>
implBitOrAssign<&i8> forWrapping<i8>
Source§fnbitor_assign(&mut self, other: &i8)
fnbitor_assign(&mut self, other: &i8)
|= operation.Read more1.22.0 (const:unstable) ·Source§implBitOrAssign<&i8> fori8
implBitOrAssign<&i8> fori8
Source§fnbitor_assign(&mut self, other: &i8)
fnbitor_assign(&mut self, other: &i8)
|= operation.Read more1.74.0 (const:unstable) ·Source§implBitOrAssign<i8> forSaturating<i8>
implBitOrAssign<i8> forSaturating<i8>
Source§fnbitor_assign(&mut self, other:i8)
fnbitor_assign(&mut self, other:i8)
|= operation.Read more1.60.0 (const:unstable) ·Source§implBitOrAssign<i8> forWrapping<i8>
implBitOrAssign<i8> forWrapping<i8>
Source§fnbitor_assign(&mut self, other:i8)
fnbitor_assign(&mut self, other:i8)
|= operation.Read more1.8.0 (const:unstable) ·Source§implBitOrAssign fori8
implBitOrAssign fori8
Source§fnbitor_assign(&mut self, other:i8)
fnbitor_assign(&mut self, other:i8)
|= operation.Read more1.74.0 (const:unstable) ·Source§implBitXorAssign<&i8> forSaturating<i8>
implBitXorAssign<&i8> forSaturating<i8>
Source§fnbitxor_assign(&mut self, other: &i8)
fnbitxor_assign(&mut self, other: &i8)
^= operation.Read more1.22.0 (const:unstable) ·Source§implBitXorAssign<&i8> forWrapping<i8>
implBitXorAssign<&i8> forWrapping<i8>
Source§fnbitxor_assign(&mut self, other: &i8)
fnbitxor_assign(&mut self, other: &i8)
^= operation.Read more1.22.0 (const:unstable) ·Source§implBitXorAssign<&i8> fori8
implBitXorAssign<&i8> fori8
Source§fnbitxor_assign(&mut self, other: &i8)
fnbitxor_assign(&mut self, other: &i8)
^= operation.Read more1.74.0 (const:unstable) ·Source§implBitXorAssign<i8> forSaturating<i8>
implBitXorAssign<i8> forSaturating<i8>
Source§fnbitxor_assign(&mut self, other:i8)
fnbitxor_assign(&mut self, other:i8)
^= operation.Read more1.60.0 (const:unstable) ·Source§implBitXorAssign<i8> forWrapping<i8>
implBitXorAssign<i8> forWrapping<i8>
Source§fnbitxor_assign(&mut self, other:i8)
fnbitxor_assign(&mut self, other:i8)
^= operation.Read more1.8.0 (const:unstable) ·Source§implBitXorAssign fori8
implBitXorAssign fori8
Source§fnbitxor_assign(&mut self, other:i8)
fnbitxor_assign(&mut self, other:i8)
^= operation.Read moreSource§implCarryingMulAdd fori8
implCarryingMulAdd fori8
Source§implDisjointBitOr fori8
implDisjointBitOr fori8
Source§unsafe fndisjoint_bitor(self, other:i8) ->i8
unsafe fndisjoint_bitor(self, other:i8) ->i8
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<i8> forRangeFull
implDistribution<i8> forRangeFull
1.0.0 (const:unstable) ·Source§implDiv fori8
This operation rounds towards zero, truncating anyfractional part of the exact result.
implDiv fori8
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<&i8> forSaturating<i8>
implDivAssign<&i8> forSaturating<i8>
Source§fndiv_assign(&mut self, other: &i8)
fndiv_assign(&mut self, other: &i8)
/= operation.Read more1.22.0 (const:unstable) ·Source§implDivAssign<&i8> forWrapping<i8>
implDivAssign<&i8> forWrapping<i8>
Source§fndiv_assign(&mut self, other: &i8)
fndiv_assign(&mut self, other: &i8)
/= operation.Read more1.22.0 (const:unstable) ·Source§implDivAssign<&i8> fori8
implDivAssign<&i8> fori8
Source§fndiv_assign(&mut self, other: &i8)
fndiv_assign(&mut self, other: &i8)
/= operation.Read more1.74.0 (const:unstable) ·Source§implDivAssign<i8> forSaturating<i8>
implDivAssign<i8> forSaturating<i8>
Source§fndiv_assign(&mut self, other:i8)
fndiv_assign(&mut self, other:i8)
/= operation.Read more1.60.0 (const:unstable) ·Source§implDivAssign<i8> forWrapping<i8>
implDivAssign<i8> forWrapping<i8>
Source§fndiv_assign(&mut self, other:i8)
fndiv_assign(&mut self, other:i8)
/= operation.Read more1.8.0 (const:unstable) ·Source§implDivAssign fori8
implDivAssign fori8
Source§fndiv_assign(&mut self, other:i8)
fndiv_assign(&mut self, other:i8)
/= operation.Read more1.0.0 (const:unstable) ·Source§implFromStr fori8
implFromStr fori8
Source§fnfrom_str(src: &str) ->Result<i8,ParseIntError>
fnfrom_str(src: &str) ->Result<i8,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<&i8> forSaturating<i8>
implMulAssign<&i8> forSaturating<i8>
Source§fnmul_assign(&mut self, other: &i8)
fnmul_assign(&mut self, other: &i8)
*= operation.Read more1.22.0 (const:unstable) ·Source§implMulAssign<&i8> forWrapping<i8>
implMulAssign<&i8> forWrapping<i8>
Source§fnmul_assign(&mut self, other: &i8)
fnmul_assign(&mut self, other: &i8)
*= operation.Read more1.22.0 (const:unstable) ·Source§implMulAssign<&i8> fori8
implMulAssign<&i8> fori8
Source§fnmul_assign(&mut self, other: &i8)
fnmul_assign(&mut self, other: &i8)
*= operation.Read more1.74.0 (const:unstable) ·Source§implMulAssign<i8> forSaturating<i8>
implMulAssign<i8> forSaturating<i8>
Source§fnmul_assign(&mut self, other:i8)
fnmul_assign(&mut self, other:i8)
*= operation.Read more1.60.0 (const:unstable) ·Source§implMulAssign<i8> forWrapping<i8>
implMulAssign<i8> forWrapping<i8>
Source§fnmul_assign(&mut self, other:i8)
fnmul_assign(&mut self, other:i8)
*= operation.Read more1.8.0 (const:unstable) ·Source§implMulAssign fori8
implMulAssign fori8
Source§fnmul_assign(&mut self, other:i8)
fnmul_assign(&mut self, other:i8)
*= operation.Read moreSource§implNumBufferTrait fori8
implNumBufferTrait fori8
1.0.0 (const:unstable) ·Source§implOrd fori8
implOrd fori8
1.0.0 (const:unstable) ·Source§implPartialOrd fori8
implPartialOrd fori8
Source§implRangePattern fori8
implRangePattern fori8
1.0.0 (const:unstable) ·Source§implRem fori8
This operation satisfiesn % d == n - (n / d) * d. Theresult has the same sign as the left operand.
implRem fori8
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<&i8> forSaturating<i8>
implRemAssign<&i8> forSaturating<i8>
Source§fnrem_assign(&mut self, other: &i8)
fnrem_assign(&mut self, other: &i8)
%= operation.Read more1.22.0 (const:unstable) ·Source§implRemAssign<&i8> forWrapping<i8>
implRemAssign<&i8> forWrapping<i8>
Source§fnrem_assign(&mut self, other: &i8)
fnrem_assign(&mut self, other: &i8)
%= operation.Read more1.22.0 (const:unstable) ·Source§implRemAssign<&i8> fori8
implRemAssign<&i8> fori8
Source§fnrem_assign(&mut self, other: &i8)
fnrem_assign(&mut self, other: &i8)
%= operation.Read more1.74.0 (const:unstable) ·Source§implRemAssign<i8> forSaturating<i8>
implRemAssign<i8> forSaturating<i8>
Source§fnrem_assign(&mut self, other:i8)
fnrem_assign(&mut self, other:i8)
%= operation.Read more1.60.0 (const:unstable) ·Source§implRemAssign<i8> forWrapping<i8>
implRemAssign<i8> forWrapping<i8>
Source§fnrem_assign(&mut self, other:i8)
fnrem_assign(&mut self, other:i8)
%= operation.Read more1.8.0 (const:unstable) ·Source§implRemAssign fori8
implRemAssign fori8
Source§fnrem_assign(&mut self, other:i8)
fnrem_assign(&mut self, other:i8)
%= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i128> fori8
implShlAssign<&i128> fori8
Source§fnshl_assign(&mut self, other: &i128)
fnshl_assign(&mut self, other: &i128)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i16> fori8
implShlAssign<&i16> fori8
Source§fnshl_assign(&mut self, other: &i16)
fnshl_assign(&mut self, other: &i16)
<<= 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<&i64> fori8
implShlAssign<&i64> fori8
Source§fnshl_assign(&mut self, other: &i64)
fnshl_assign(&mut self, other: &i64)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i8> fori128
implShlAssign<&i8> fori128
Source§fnshl_assign(&mut self, other: &i8)
fnshl_assign(&mut self, other: &i8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i8> fori16
implShlAssign<&i8> fori16
Source§fnshl_assign(&mut self, other: &i8)
fnshl_assign(&mut self, other: &i8)
<<= 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<&i8> fori64
implShlAssign<&i8> fori64
Source§fnshl_assign(&mut self, other: &i8)
fnshl_assign(&mut self, other: &i8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i8> fori8
implShlAssign<&i8> fori8
Source§fnshl_assign(&mut self, other: &i8)
fnshl_assign(&mut self, other: &i8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i8> forisize
implShlAssign<&i8> forisize
Source§fnshl_assign(&mut self, other: &i8)
fnshl_assign(&mut self, other: &i8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i8> foru128
implShlAssign<&i8> foru128
Source§fnshl_assign(&mut self, other: &i8)
fnshl_assign(&mut self, other: &i8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i8> foru16
implShlAssign<&i8> foru16
Source§fnshl_assign(&mut self, other: &i8)
fnshl_assign(&mut self, other: &i8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i8> foru32
implShlAssign<&i8> foru32
Source§fnshl_assign(&mut self, other: &i8)
fnshl_assign(&mut self, other: &i8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i8> foru64
implShlAssign<&i8> foru64
Source§fnshl_assign(&mut self, other: &i8)
fnshl_assign(&mut self, other: &i8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i8> foru8
implShlAssign<&i8> foru8
Source§fnshl_assign(&mut self, other: &i8)
fnshl_assign(&mut self, other: &i8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&i8> forusize
implShlAssign<&i8> forusize
Source§fnshl_assign(&mut self, other: &i8)
fnshl_assign(&mut self, other: &i8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&isize> fori8
implShlAssign<&isize> fori8
Source§fnshl_assign(&mut self, other: &isize)
fnshl_assign(&mut self, other: &isize)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&u128> fori8
implShlAssign<&u128> fori8
Source§fnshl_assign(&mut self, other: &u128)
fnshl_assign(&mut self, other: &u128)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&u16> fori8
implShlAssign<&u16> fori8
Source§fnshl_assign(&mut self, other: &u16)
fnshl_assign(&mut self, other: &u16)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&u32> fori8
implShlAssign<&u32> fori8
Source§fnshl_assign(&mut self, other: &u32)
fnshl_assign(&mut self, other: &u32)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&u64> fori8
implShlAssign<&u64> fori8
Source§fnshl_assign(&mut self, other: &u64)
fnshl_assign(&mut self, other: &u64)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&u8> fori8
implShlAssign<&u8> fori8
Source§fnshl_assign(&mut self, other: &u8)
fnshl_assign(&mut self, other: &u8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShlAssign<&usize> fori8
implShlAssign<&usize> fori8
Source§fnshl_assign(&mut self, other: &usize)
fnshl_assign(&mut self, other: &usize)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i128> fori8
implShlAssign<i128> fori8
Source§fnshl_assign(&mut self, other:i128)
fnshl_assign(&mut self, other:i128)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i16> fori8
implShlAssign<i16> fori8
Source§fnshl_assign(&mut self, other:i16)
fnshl_assign(&mut self, other:i16)
<<= 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<i64> fori8
implShlAssign<i64> fori8
Source§fnshl_assign(&mut self, other:i64)
fnshl_assign(&mut self, other:i64)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i8> fori128
implShlAssign<i8> fori128
Source§fnshl_assign(&mut self, other:i8)
fnshl_assign(&mut self, other:i8)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i8> fori16
implShlAssign<i8> fori16
Source§fnshl_assign(&mut self, other:i8)
fnshl_assign(&mut self, other:i8)
<<= 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<i8> fori64
implShlAssign<i8> fori64
Source§fnshl_assign(&mut self, other:i8)
fnshl_assign(&mut self, other:i8)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i8> forisize
implShlAssign<i8> forisize
Source§fnshl_assign(&mut self, other:i8)
fnshl_assign(&mut self, other:i8)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i8> foru128
implShlAssign<i8> foru128
Source§fnshl_assign(&mut self, other:i8)
fnshl_assign(&mut self, other:i8)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i8> foru16
implShlAssign<i8> foru16
Source§fnshl_assign(&mut self, other:i8)
fnshl_assign(&mut self, other:i8)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i8> foru32
implShlAssign<i8> foru32
Source§fnshl_assign(&mut self, other:i8)
fnshl_assign(&mut self, other:i8)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i8> foru64
implShlAssign<i8> foru64
Source§fnshl_assign(&mut self, other:i8)
fnshl_assign(&mut self, other:i8)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i8> foru8
implShlAssign<i8> foru8
Source§fnshl_assign(&mut self, other:i8)
fnshl_assign(&mut self, other:i8)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<i8> forusize
implShlAssign<i8> forusize
Source§fnshl_assign(&mut self, other:i8)
fnshl_assign(&mut self, other:i8)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<isize> fori8
implShlAssign<isize> fori8
Source§fnshl_assign(&mut self, other:isize)
fnshl_assign(&mut self, other:isize)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<u128> fori8
implShlAssign<u128> fori8
Source§fnshl_assign(&mut self, other:u128)
fnshl_assign(&mut self, other:u128)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<u16> fori8
implShlAssign<u16> fori8
Source§fnshl_assign(&mut self, other:u16)
fnshl_assign(&mut self, other:u16)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<u32> fori8
implShlAssign<u32> fori8
Source§fnshl_assign(&mut self, other:u32)
fnshl_assign(&mut self, other:u32)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<u64> fori8
implShlAssign<u64> fori8
Source§fnshl_assign(&mut self, other:u64)
fnshl_assign(&mut self, other:u64)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<u8> fori8
implShlAssign<u8> fori8
Source§fnshl_assign(&mut self, other:u8)
fnshl_assign(&mut self, other:u8)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign<usize> fori8
implShlAssign<usize> fori8
Source§fnshl_assign(&mut self, other:usize)
fnshl_assign(&mut self, other:usize)
<<= operation.Read more1.8.0 (const:unstable) ·Source§implShlAssign fori8
implShlAssign fori8
Source§fnshl_assign(&mut self, other:i8)
fnshl_assign(&mut self, other:i8)
<<= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i128> fori8
implShrAssign<&i128> fori8
Source§fnshr_assign(&mut self, other: &i128)
fnshr_assign(&mut self, other: &i128)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i16> fori8
implShrAssign<&i16> fori8
Source§fnshr_assign(&mut self, other: &i16)
fnshr_assign(&mut self, other: &i16)
>>= 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<&i64> fori8
implShrAssign<&i64> fori8
Source§fnshr_assign(&mut self, other: &i64)
fnshr_assign(&mut self, other: &i64)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i8> fori128
implShrAssign<&i8> fori128
Source§fnshr_assign(&mut self, other: &i8)
fnshr_assign(&mut self, other: &i8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i8> fori16
implShrAssign<&i8> fori16
Source§fnshr_assign(&mut self, other: &i8)
fnshr_assign(&mut self, other: &i8)
>>= 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<&i8> fori64
implShrAssign<&i8> fori64
Source§fnshr_assign(&mut self, other: &i8)
fnshr_assign(&mut self, other: &i8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i8> fori8
implShrAssign<&i8> fori8
Source§fnshr_assign(&mut self, other: &i8)
fnshr_assign(&mut self, other: &i8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i8> forisize
implShrAssign<&i8> forisize
Source§fnshr_assign(&mut self, other: &i8)
fnshr_assign(&mut self, other: &i8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i8> foru128
implShrAssign<&i8> foru128
Source§fnshr_assign(&mut self, other: &i8)
fnshr_assign(&mut self, other: &i8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i8> foru16
implShrAssign<&i8> foru16
Source§fnshr_assign(&mut self, other: &i8)
fnshr_assign(&mut self, other: &i8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i8> foru32
implShrAssign<&i8> foru32
Source§fnshr_assign(&mut self, other: &i8)
fnshr_assign(&mut self, other: &i8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i8> foru64
implShrAssign<&i8> foru64
Source§fnshr_assign(&mut self, other: &i8)
fnshr_assign(&mut self, other: &i8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i8> foru8
implShrAssign<&i8> foru8
Source§fnshr_assign(&mut self, other: &i8)
fnshr_assign(&mut self, other: &i8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&i8> forusize
implShrAssign<&i8> forusize
Source§fnshr_assign(&mut self, other: &i8)
fnshr_assign(&mut self, other: &i8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&isize> fori8
implShrAssign<&isize> fori8
Source§fnshr_assign(&mut self, other: &isize)
fnshr_assign(&mut self, other: &isize)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&u128> fori8
implShrAssign<&u128> fori8
Source§fnshr_assign(&mut self, other: &u128)
fnshr_assign(&mut self, other: &u128)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&u16> fori8
implShrAssign<&u16> fori8
Source§fnshr_assign(&mut self, other: &u16)
fnshr_assign(&mut self, other: &u16)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&u32> fori8
implShrAssign<&u32> fori8
Source§fnshr_assign(&mut self, other: &u32)
fnshr_assign(&mut self, other: &u32)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&u64> fori8
implShrAssign<&u64> fori8
Source§fnshr_assign(&mut self, other: &u64)
fnshr_assign(&mut self, other: &u64)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&u8> fori8
implShrAssign<&u8> fori8
Source§fnshr_assign(&mut self, other: &u8)
fnshr_assign(&mut self, other: &u8)
>>= operation.Read more1.22.0 (const:unstable) ·Source§implShrAssign<&usize> fori8
implShrAssign<&usize> fori8
Source§fnshr_assign(&mut self, other: &usize)
fnshr_assign(&mut self, other: &usize)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i128> fori8
implShrAssign<i128> fori8
Source§fnshr_assign(&mut self, other:i128)
fnshr_assign(&mut self, other:i128)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i16> fori8
implShrAssign<i16> fori8
Source§fnshr_assign(&mut self, other:i16)
fnshr_assign(&mut self, other:i16)
>>= 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<i64> fori8
implShrAssign<i64> fori8
Source§fnshr_assign(&mut self, other:i64)
fnshr_assign(&mut self, other:i64)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i8> fori128
implShrAssign<i8> fori128
Source§fnshr_assign(&mut self, other:i8)
fnshr_assign(&mut self, other:i8)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i8> fori16
implShrAssign<i8> fori16
Source§fnshr_assign(&mut self, other:i8)
fnshr_assign(&mut self, other:i8)
>>= 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<i8> fori64
implShrAssign<i8> fori64
Source§fnshr_assign(&mut self, other:i8)
fnshr_assign(&mut self, other:i8)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i8> forisize
implShrAssign<i8> forisize
Source§fnshr_assign(&mut self, other:i8)
fnshr_assign(&mut self, other:i8)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i8> foru128
implShrAssign<i8> foru128
Source§fnshr_assign(&mut self, other:i8)
fnshr_assign(&mut self, other:i8)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i8> foru16
implShrAssign<i8> foru16
Source§fnshr_assign(&mut self, other:i8)
fnshr_assign(&mut self, other:i8)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i8> foru32
implShrAssign<i8> foru32
Source§fnshr_assign(&mut self, other:i8)
fnshr_assign(&mut self, other:i8)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i8> foru64
implShrAssign<i8> foru64
Source§fnshr_assign(&mut self, other:i8)
fnshr_assign(&mut self, other:i8)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i8> foru8
implShrAssign<i8> foru8
Source§fnshr_assign(&mut self, other:i8)
fnshr_assign(&mut self, other:i8)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<i8> forusize
implShrAssign<i8> forusize
Source§fnshr_assign(&mut self, other:i8)
fnshr_assign(&mut self, other:i8)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<isize> fori8
implShrAssign<isize> fori8
Source§fnshr_assign(&mut self, other:isize)
fnshr_assign(&mut self, other:isize)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<u128> fori8
implShrAssign<u128> fori8
Source§fnshr_assign(&mut self, other:u128)
fnshr_assign(&mut self, other:u128)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<u16> fori8
implShrAssign<u16> fori8
Source§fnshr_assign(&mut self, other:u16)
fnshr_assign(&mut self, other:u16)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<u32> fori8
implShrAssign<u32> fori8
Source§fnshr_assign(&mut self, other:u32)
fnshr_assign(&mut self, other:u32)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<u64> fori8
implShrAssign<u64> fori8
Source§fnshr_assign(&mut self, other:u64)
fnshr_assign(&mut self, other:u64)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<u8> fori8
implShrAssign<u8> fori8
Source§fnshr_assign(&mut self, other:u8)
fnshr_assign(&mut self, other:u8)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign<usize> fori8
implShrAssign<usize> fori8
Source§fnshr_assign(&mut self, other:usize)
fnshr_assign(&mut self, other:usize)
>>= operation.Read more1.8.0 (const:unstable) ·Source§implShrAssign fori8
implShrAssign fori8
Source§fnshr_assign(&mut self, other:i8)
fnshr_assign(&mut self, other:i8)
>>= operation.Read moreSource§implSimdElement fori8
implSimdElement fori8
Source§implStep fori8
implStep fori8
Source§fnforward(start:i8, n:usize) ->i8
fnforward(start:i8, n:usize) ->i8
step_trait #42168)Source§fnbackward(start:i8, n:usize) ->i8
fnbackward(start:i8, n:usize) ->i8
step_trait #42168)Source§unsafe fnforward_unchecked(start:i8, n:usize) ->i8
unsafe fnforward_unchecked(start:i8, n:usize) ->i8
step_trait #42168)Source§unsafe fnbackward_unchecked(start:i8, n:usize) ->i8
unsafe fnbackward_unchecked(start:i8, n:usize) ->i8
step_trait #42168)Source§fnsteps_between(start: &i8, end: &i8) -> (usize,Option<usize>)
fnsteps_between(start: &i8, end: &i8) -> (usize,Option<usize>)
step_trait #42168)start toendlikeIterator::size_hint().Read more1.74.0 (const:unstable) ·Source§implSubAssign<&i8> forSaturating<i8>
implSubAssign<&i8> forSaturating<i8>
Source§fnsub_assign(&mut self, other: &i8)
fnsub_assign(&mut self, other: &i8)
-= operation.Read more1.22.0 (const:unstable) ·Source§implSubAssign<&i8> forWrapping<i8>
implSubAssign<&i8> forWrapping<i8>
Source§fnsub_assign(&mut self, other: &i8)
fnsub_assign(&mut self, other: &i8)
-= operation.Read more1.22.0 (const:unstable) ·Source§implSubAssign<&i8> fori8
implSubAssign<&i8> fori8
Source§fnsub_assign(&mut self, other: &i8)
fnsub_assign(&mut self, other: &i8)
-= operation.Read more1.74.0 (const:unstable) ·Source§implSubAssign<i8> forSaturating<i8>
implSubAssign<i8> forSaturating<i8>
Source§fnsub_assign(&mut self, other:i8)
fnsub_assign(&mut self, other:i8)
-= operation.Read more1.60.0 (const:unstable) ·Source§implSubAssign<i8> forWrapping<i8>
implSubAssign<i8> forWrapping<i8>
Source§fnsub_assign(&mut self, other:i8)
fnsub_assign(&mut self, other:i8)
-= operation.Read more1.8.0 (const:unstable) ·Source§implSubAssign fori8
implSubAssign fori8
Source§fnsub_assign(&mut self, other:i8)
fnsub_assign(&mut self, other:i8)
-= operation.Read more1.34.0 (const:unstable) ·Source§implTryFrom<i128> fori8
implTryFrom<i128> fori8
Source§fntry_from(u:i128) ->Result<i8, <i8 asTryFrom<i128>>::Error>
fntry_from(u:i128) ->Result<i8, <i8 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<i16> fori8
implTryFrom<i16> fori8
Source§fntry_from(u:i16) ->Result<i8, <i8 asTryFrom<i16>>::Error>
fntry_from(u:i16) ->Result<i8, <i8 asTryFrom<i16>>::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<i64> fori8
implTryFrom<i64> fori8
Source§fntry_from(u:i64) ->Result<i8, <i8 asTryFrom<i64>>::Error>
fntry_from(u:i64) ->Result<i8, <i8 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<i8> foru128
implTryFrom<i8> foru128
Source§fntry_from(u:i8) ->Result<u128, <u128 asTryFrom<i8>>::Error>
fntry_from(u:i8) ->Result<u128, <u128 asTryFrom<i8>>::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<i8> foru16
implTryFrom<i8> foru16
Source§fntry_from(u:i8) ->Result<u16, <u16 asTryFrom<i8>>::Error>
fntry_from(u:i8) ->Result<u16, <u16 asTryFrom<i8>>::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<i8> foru32
implTryFrom<i8> foru32
Source§fntry_from(u:i8) ->Result<u32, <u32 asTryFrom<i8>>::Error>
fntry_from(u:i8) ->Result<u32, <u32 asTryFrom<i8>>::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<i8> foru64
implTryFrom<i8> foru64
Source§fntry_from(u:i8) ->Result<u64, <u64 asTryFrom<i8>>::Error>
fntry_from(u:i8) ->Result<u64, <u64 asTryFrom<i8>>::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<i8> forusize
implTryFrom<i8> forusize
Source§fntry_from(u:i8) ->Result<usize, <usize asTryFrom<i8>>::Error>
fntry_from(u:i8) ->Result<usize, <usize asTryFrom<i8>>::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> fori8
implTryFrom<isize> fori8
Source§fntry_from(u:isize) ->Result<i8, <i8 asTryFrom<isize>>::Error>
fntry_from(u:isize) ->Result<i8, <i8 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> fori8
implTryFrom<u128> fori8
Source§fntry_from(u:u128) ->Result<i8, <i8 asTryFrom<u128>>::Error>
fntry_from(u:u128) ->Result<i8, <i8 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<u16> fori8
implTryFrom<u16> fori8
Source§fntry_from(u:u16) ->Result<i8, <i8 asTryFrom<u16>>::Error>
fntry_from(u:u16) ->Result<i8, <i8 asTryFrom<u16>>::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> fori8
implTryFrom<u32> fori8
Source§fntry_from(u:u32) ->Result<i8, <i8 asTryFrom<u32>>::Error>
fntry_from(u:u32) ->Result<i8, <i8 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> fori8
implTryFrom<u64> fori8
Source§fntry_from(u:u64) ->Result<i8, <i8 asTryFrom<u64>>::Error>
fntry_from(u:u64) ->Result<i8, <i8 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> fori8
implTryFrom<usize> fori8
Source§fntry_from(u:usize) ->Result<i8, <i8 asTryFrom<usize>>::Error>
fntry_from(u:usize) ->Result<i8, <i8 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.