Enum rustc_trans::middle::const_val::ConstInt
[−]
[src]
pub enum ConstInt { I8(i8), I16(i16), I32(i32), I64(i64), I128(i128), Isize(ConstIsize), U8(u8), U16(u16), U32(u32), U64(u64), U128(u128), Usize(ConstUsize), }
rustc_private
)Variants
I8(i8)
rustc_private
)I16(i16)
rustc_private
)I32(i32)
rustc_private
)I64(i64)
rustc_private
)I128(i128)
rustc_private
)Isize(ConstIsize)
rustc_private
)U8(u8)
rustc_private
)U16(u16)
rustc_private
)U32(u32)
rustc_private
)U64(u64)
rustc_private
)U128(u128)
rustc_private
)Usize(ConstUsize)
rustc_private
)Methods
impl ConstInt
[src]
fn new_unsigned(val: u128, ty: UintTy, usize_ty: UintTy) -> Option<ConstInt>
rustc_private
)Creates a new unsigned ConstInt with matching type while also checking that overflow does not happen.
fn new_signed(val: i128, ty: IntTy, isize_ty: IntTy) -> Option<ConstInt>
rustc_private
)Creates a new signed ConstInt with matching type while also checking that overflow does not happen.
fn new_unsigned_truncating(val: u128, ty: UintTy, usize_ty: UintTy) -> ConstInt
rustc_private
)Creates a new unsigned ConstInt with matching type.
fn new_signed_truncating(val: i128, ty: IntTy, isize_ty: IntTy) -> ConstInt
rustc_private
)Creates a new signed ConstInt with matching type.
fn description(&self) -> &'static str
rustc_private
)Description of the type, not the value
fn to_u128_unchecked(self) -> u128
rustc_private
)Erases the type and returns a u128.
This is not the same as -5i8 as u128
but as -5i8 as i128 as u128
fn to_u32(&self) -> Option<u32>
rustc_private
)Converts the value to a u32
if it's in the range 0...std::u32::MAX
fn to_u64(&self) -> Option<u64>
rustc_private
)Converts the value to a u64
if it's in the range 0...std::u64::MAX
fn to_u128(&self) -> Option<u128>
rustc_private
)Converts the value to a u128
if it's in the range 0...std::u128::MAX
fn to_f32(self) -> f32
rustc_private
)fn to_f64(self) -> f64
rustc_private
)fn is_negative(&self) -> bool
rustc_private
)fn try_cmp(self, rhs: ConstInt) -> Result<Ordering, ConstMathErr>
rustc_private
)Compares the values if they are of the same type
fn wrap_incr(self) -> ConstInt
rustc_private
)Adds 1 to the value and wraps around if the maximum for the type is reached
fn int_type(self) -> IntType
rustc_private
)Trait Implementations
impl BitXor<ConstInt> for ConstInt
[src]
type Output = Result<ConstInt, ConstMathErr>
The resulting type after applying the ^
operator
fn bitxor(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>
The method for the ^
operator
impl Hash for ConstInt
[src]
fn hash<__H>(&self, __arg_0: &mut __H) where __H: Hasher
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 Eq for ConstInt
[src]
impl Decodable for ConstInt
[src]
fn decode<__D>(__arg_0: &mut __D) -> Result<ConstInt, __D::Error> where __D: Decoder
rustc_private
)impl PartialOrd<ConstInt> for ConstInt
[src]
fn partial_cmp(&self, other: &ConstInt) -> 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 Debug for ConstInt
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl Sub<ConstInt> for ConstInt
[src]
type Output = Result<ConstInt, ConstMathErr>
The resulting type after applying the -
operator
fn sub(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>
The method for the -
operator
impl Not for ConstInt
[src]
type Output = Result<ConstInt, ConstMathErr>
The resulting type after applying the !
operator
fn not(self) -> Result<ConstInt, ConstMathErr>
The method for the unary !
operator
impl BitOr<ConstInt> for ConstInt
[src]
type Output = Result<ConstInt, ConstMathErr>
The resulting type after applying the |
operator
fn bitor(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>
The method for the |
operator
impl Div<ConstInt> for ConstInt
[src]
type Output = Result<ConstInt, ConstMathErr>
rustc_private
)fn div(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>
rustc_private
)impl BitAnd<ConstInt> for ConstInt
[src]
type Output = Result<ConstInt, ConstMathErr>
The resulting type after applying the &
operator
fn bitand(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>
The method for the &
operator
impl Shl<ConstInt> for ConstInt
[src]
type Output = Result<ConstInt, ConstMathErr>
rustc_private
)fn shl(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>
rustc_private
)impl Display for ConstInt
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Add<ConstInt> for ConstInt
[src]
type Output = Result<ConstInt, ConstMathErr>
rustc_private
)fn add(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>
rustc_private
)impl Rem<ConstInt> for ConstInt
[src]
type Output = Result<ConstInt, ConstMathErr>
rustc_private
)fn rem(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>
rustc_private
)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 Shr<ConstInt> for ConstInt
[src]
type Output = Result<ConstInt, ConstMathErr>
rustc_private
)fn shr(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>
rustc_private
)impl Mul<ConstInt> for ConstInt
[src]
type Output = Result<ConstInt, ConstMathErr>
The resulting type after applying the *
operator
fn mul(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>
The method for the *
operator
impl PartialEq<ConstInt> 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 Encodable for ConstInt
[src]
fn encode<__S>(&self, __arg_0: &mut __S) -> Result<(), __S::Error> where __S: Encoder
rustc_private
)impl Copy for ConstInt
[src]
impl Neg for ConstInt
[src]
type Output = Result<ConstInt, ConstMathErr>
rustc_private
)fn neg(self) -> Result<ConstInt, ConstMathErr>
rustc_private
)