Enum rustc::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),
}🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Variants
I8(i8)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
I16(i16)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
I32(i32)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
I64(i64)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
I128(i128)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Isize(ConstIsize)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
U8(u8)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
U16(u16)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
U32(u32)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
U64(u64)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
U128(u128)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Usize(ConstUsize)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Methods
impl ConstInt[src]
pub fn new_unsigned(val: u128, ty: UintTy, usize_ty: UintTy) -> Option<ConstInt>[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Creates a new unsigned ConstInt with matching type while also checking that overflow does not happen.
pub fn new_signed(val: i128, ty: IntTy, isize_ty: IntTy) -> Option<ConstInt>[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Creates a new signed ConstInt with matching type while also checking that overflow does not happen.
pub fn new_unsigned_truncating(
val: u128,
ty: UintTy,
usize_ty: UintTy
) -> ConstInt[src]
val: u128,
ty: UintTy,
usize_ty: UintTy
) -> ConstInt
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Creates a new unsigned ConstInt with matching type.
pub fn new_signed_truncating(val: i128, ty: IntTy, isize_ty: IntTy) -> ConstInt[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Creates a new signed ConstInt with matching type.
pub fn description(&self) -> &'static str[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Description of the type, not the value
pub fn to_u128_unchecked(self) -> u128[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Erases the type and returns a u128.
This is not the same as -5i8 as u128 but as -5i8 as i128 as u128
pub fn to_u32(&self) -> Option<u32>[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Converts the value to a u32 if it's in the range 0...std::u32::MAX
pub fn to_u64(&self) -> Option<u64>[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Converts the value to a u64 if it's in the range 0...std::u64::MAX
pub fn to_u128(&self) -> Option<u128>[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Converts the value to a u128 if it's in the range 0...std::u128::MAX
pub fn is_negative(&self) -> bool[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn try_cmp(self, rhs: ConstInt) -> Result<Ordering, ConstMathErr>[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Compares the values if they are of the same type
pub fn wrap_incr(self) -> ConstInt[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Adds 1 to the value and wraps around if the maximum for the type is reached
pub fn int_type(self) -> IntType[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Trait Implementations
impl<'tcx> HashStable<StableHashingContext<'tcx>> for ConstInt[src]
fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'tcx>,
__hasher: &mut StableHasher<W>
)[src]
&self,
__ctx: &mut StableHashingContext<'tcx>,
__hasher: &mut StableHasher<W>
)
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl Encodable for ConstInt[src]
fn encode<__S>(&self, __arg_0: &mut __S) -> Result<(), <__S as Encoder>::Error> where
__S: Encoder, [src]
__S: Encoder,
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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>[src]
Performs the - operation.
impl Shr<ConstInt> for ConstInt[src]
type Output = Result<ConstInt, ConstMathErr>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn shr(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl PartialOrd<ConstInt> for ConstInt[src]
fn partial_cmp(&self, other: &ConstInt) -> Option<Ordering>[src]
This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
This method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &Rhs) -> bool1.0.0[src]
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) -> bool1.0.0[src]
This method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Add<ConstInt> for ConstInt[src]
type Output = Result<ConstInt, ConstMathErr>
The resulting type after applying the + operator.
fn add(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>[src]
Performs the + operation.
impl PartialEq<ConstInt> for ConstInt[src]
fn eq(&self, __arg_0: &ConstInt) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &ConstInt) -> bool[src]
This method tests for !=.
impl Ord for ConstInt[src]
fn cmp(&self, other: &ConstInt) -> Ordering[src]
This method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Decodable for ConstInt[src]
fn decode<__D>(__arg_0: &mut __D) -> Result<ConstInt, <__D as Decoder>::Error> where
__D: Decoder, [src]
__D: Decoder,
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl Copy for ConstInt[src]
impl Not for ConstInt[src]
type Output = Result<ConstInt, ConstMathErr>
The resulting type after applying the ! operator.
fn not(self) -> Result<ConstInt, ConstMathErr>[src]
Performs the unary ! operation.
impl Div<ConstInt> for ConstInt[src]
type Output = Result<ConstInt, ConstMathErr>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn div(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl Debug for ConstInt[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>[src]
Formats the value using the given formatter. Read more
impl Eq for ConstInt[src]
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>[src]
Performs the * operation.
impl Hash for ConstInt[src]
fn hash<__H>(&self, __arg_0: &mut __H) where
__H: Hasher, [src]
__H: Hasher,
Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
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>[src]
Performs the | operation.
impl Rem<ConstInt> for ConstInt[src]
type Output = Result<ConstInt, ConstMathErr>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn rem(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl Neg for ConstInt[src]
type Output = Result<ConstInt, ConstMathErr>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn neg(self) -> Result<ConstInt, ConstMathErr>[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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>[src]
Performs the & operation.
impl Display for ConstInt[src]
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>[src]
Formats the value using the given formatter. Read more
impl Shl<ConstInt> for ConstInt[src]
type Output = Result<ConstInt, ConstMathErr>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn shl(self, rhs: ConstInt) -> Result<ConstInt, ConstMathErr>[src]
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl Clone for ConstInt[src]
fn clone(&self) -> ConstInt[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
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>[src]
Performs the ^ operation.