Enum rustc_const_math::ConstInt [] [src]

pub enum ConstInt {
    I8(i8),
    I16(i16),
    I32(i32),
    I64(i64),
    Isize(ConstIsize),
    U8(u8),
    U16(u16),
    U32(u32),
    U64(u64),
    Usize(ConstUsize),
    Infer(u64),
    InferSigned(i64),
}
Unstable (rustc_private)

Variants

I8(i8)
Unstable (rustc_private)
I16(i16)
Unstable (rustc_private)
I32(i32)
Unstable (rustc_private)
I64(i64)
Unstable (rustc_private)
Isize(ConstIsize)
Unstable (rustc_private)
U8(u8)
Unstable (rustc_private)
U16(u16)
Unstable (rustc_private)
U32(u32)
Unstable (rustc_private)
U64(u64)
Unstable (rustc_private)
Usize(ConstUsize)
Unstable (rustc_private)
Infer(u64)
Unstable (rustc_private)
InferSigned(i64)
Unstable (rustc_private)

Methods

impl ConstInt
[src]

fn infer(self, other: Self) -> Result<(Self, Self)ConstMathErr>

Unstable (rustc_private)

If either value is Infer or InferSigned, try to turn the value into the type of the other value. If both values have no type, don't do anything

fn erase_type(self) -> Self

Unstable (rustc_private)

Turn this value into an Infer or an InferSigned

fn description(&self) -> &'static str

Unstable (rustc_private)

Description of the type, not the value

fn to_u64_unchecked(self) -> u64

Unstable (rustc_private)

Erases the type and returns a u64. This is not the same as -5i8 as u64 but as -5i8 as i64 as u64

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

Unstable (rustc_private)

Converts the value to a u32 if it's in the range 0...std::u32::MAX

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

Unstable (rustc_private)

Converts the value to a u64 if it's >= 0

fn is_negative(&self) -> bool

fn try_cmp(self, rhs: Self) -> Result<OrderingConstMathErr>

Unstable (rustc_private)

Compares the values if they are of the same type

fn wrap_incr(self) -> Self

Unstable (rustc_private)

Adds 1 to the value and wraps around if the maximum for the type is reached

fn int_type(self) -> Option<IntType>

Trait Implementations

impl PartialOrd for ConstInt
[src]

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

This method returns an ordering between self and other values if one exists. Read more

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

This method tests less than (for self and other) and is used by the < operator. Read more

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

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

This method tests greater than (for self and other) and is used by the > operator. Read more

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for ConstInt
[src]

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

This method returns an Ordering between self and other. Read more

impl Display for ConstInt
[src]

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

Formats the value using the given formatter.

impl Add for ConstInt
[src]

type Output = Result<Self, ConstMathErr>

The resulting type after applying the + operator

fn add(self, rhs: Self) -> Result<Self, ConstMathErr>

The method for the + operator

impl Sub for ConstInt
[src]

type Output = Result<Self, ConstMathErr>

The resulting type after applying the - operator

fn sub(self, rhs: Self) -> Result<Self, ConstMathErr>

The method for the - operator

impl Mul for ConstInt
[src]

type Output = Result<Self, ConstMathErr>

The resulting type after applying the * operator

fn mul(self, rhs: Self) -> Result<Self, ConstMathErr>

The method for the * operator

impl BitAnd for ConstInt
[src]

type Output = Result<Self, ConstMathErr>

The resulting type after applying the & operator

fn bitand(self, rhs: Self) -> Result<Self, ConstMathErr>

The method for the & operator

impl BitOr for ConstInt
[src]

type Output = Result<Self, ConstMathErr>

The resulting type after applying the | operator

fn bitor(self, rhs: Self) -> Result<Self, ConstMathErr>

The method for the | operator

impl BitXor for ConstInt
[src]

type Output = Result<Self, ConstMathErr>

The resulting type after applying the ^ operator

fn bitxor(self, rhs: Self) -> Result<Self, ConstMathErr>

The method for the ^ operator

impl Div for ConstInt
[src]

type Output = Result<Self, ConstMathErr>

The resulting type after applying the / operator

fn div(self, rhs: Self) -> Result<Self, ConstMathErr>

The method for the / operator

impl Rem for ConstInt
[src]

type Output = Result<Self, ConstMathErr>

The resulting type after applying the % operator

fn rem(self, rhs: Self) -> Result<Self, ConstMathErr>

The method for the % operator

impl Shl<ConstInt> for ConstInt
[src]

type Output = Result<Self, ConstMathErr>

The resulting type after applying the << operator

fn shl(self, rhs: Self) -> Result<Self, ConstMathErr>

The method for the << operator

impl Shr<ConstInt> for ConstInt
[src]

type Output = Result<Self, ConstMathErr>

The resulting type after applying the >> operator

fn shr(self, rhs: Self) -> Result<Self, ConstMathErr>

The method for the >> operator

impl Neg for ConstInt
[src]

type Output = Result<Self, ConstMathErr>

The resulting type after applying the - operator

fn neg(self) -> Result<Self, ConstMathErr>

The method for the unary - operator

impl Not for ConstInt
[src]

type Output = Result<Self, ConstMathErr>

The resulting type after applying the ! operator

fn not(self) -> Result<Self, ConstMathErr>

The method for the unary ! operator

Derived Implementations

impl PartialEq for ConstInt
[src]

fn eq(&self, __arg_0: &ConstInt) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &ConstInt) -> bool

This method tests for !=.

impl Eq for ConstInt
[src]

impl Hash for ConstInt
[src]

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

Feeds this value into the state given, updating the hasher as necessary.

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

Feeds a slice of this type into the state provided.

impl Decodable for ConstInt
[src]

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<ConstInt, __D::Error>

impl Encodable for ConstInt
[src]

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl Debug for ConstInt
[src]

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

Formats the value using the given formatter.

impl Clone for ConstInt
[src]

fn clone(&self) -> ConstInt

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Copy for ConstInt
[src]