Signed 8-bit integer
Methods
impl i8 { ... }
- 
fn max_value() -> i8Returns the maximum value of i8.
- 
fn min_value() -> i8Returns the minimum value of i8.
Mixins
impl i8 { ... }
- 
mixin WithOverflow<i8>
- 
Adds two numbers, wrapping around at the boundary of the type. 
- 
Subtracts two numbers, wrapping around at the boundary of the type. 
- 
Multiplies two numbers, wrapping around at the boundary of the type. 
- 
Divides two numbers, wrapping around at the boundary of the type. The only case where such wrapping can occur is when one divides MIN / -1on a signed type. This is equivalent to-MIN, a number that is too large to represent in the type. In such a case, this function returnsMINitself.
- 
Tries to add two numbers, returning Option::none()if overflow occurrs.
- 
Tries to subtract two numbers, returning Option::none()if overflow occurrs.
- 
Tries to multiply two numbers, returning Option::none()if overflow occurrs.
- 
Tries to divide two numbers, returning Option::none()if overflow occurrs orrhsis zero.Overflow during division can only happen when one divides MIN / -1on a signed type.
- 
mixin BuiltinComparable<i8>
- 
Returns falseif arguments are equal,trueotherwise
- 
Returns trueiflhsis strictly less thanrhs,falseotherwise
- 
Returns trueiflhsis less or equal torhs,falseotherwise
- 
Returns trueiflhsstrictly greater thanrhs,falseotherwise
- 
Returns trueiflhsgreater than or equalrhs,falseotherwise
- 
mixin<H> IntegerHashable<i8, H>H: Hasher<H>
- 
fn hash(self: &Self, hasher: &mut H)
- 
mixin<F> IntegerFormattable<i8, F>F: Formatter<F>
- 
mixin IntegerParsable<i8>
- 
Parses the integer from a base-10 string. If the string does not represent a valid integer, Option::none()is returned.Exampleassert_eq!(i32::parse("10"), Option::some(10)); assert_eq!(i32::parse("foo"), Option::none());Run this example
- 
Parses the integer from a string in a given base. If the string does not represent a valid integer in the given base, Option::none()is returned.Exampleassert_eq!(i32::parse_with_radix("10", 2), Option::some(2)); assert_eq!(u64::parse_with_radix("deadbeef", 16), Option::some(0xdeadbeefu64)); assert_eq!(i32::parse_with_radix("foo", 10), Option::none());Run this example