pub enum Constant {
Int(BigInt),
Real(Real),
Bool(bool),
Str(Symbol),
Char(char),
}
Variants§
Implementations§
Source§impl Constant
impl Constant
pub const ZERO: Constant = _
pub const ONE: Constant = _
pub const TRUE: Constant = _
fn to_bool(self) -> Option<bool>
fn to_int(self) -> Option<BigInt>
pub fn iff(&self, other: &Constant) -> Option<Constant>
pub fn imp(&self, other: &Constant) -> Option<Constant>
pub fn or(&self, other: &Constant) -> Option<Constant>
pub fn and(&self, other: &Constant) -> Option<Constant>
pub fn eq(&self, other: &Constant) -> Constant
pub fn ne(&self, other: &Constant) -> Constant
pub fn gt(&self, other: &Constant) -> Option<Constant>
pub fn ge(&self, other: &Constant) -> Option<Constant>
pub fn from_scalar_int<'tcx, T>( tcx: TyCtxt<'tcx>, scalar: ScalarInt, t: &T, ) -> Option<Self>
Sourcepub fn int_min(bit_width: u32) -> Constant
pub fn int_min(bit_width: u32) -> Constant
See BigInt::int_min
Sourcepub fn int_max(bit_width: u32) -> Constant
pub fn int_max(bit_width: u32) -> Constant
See BigInt::int_max
Sourcepub fn uint_max(bit_width: u32) -> Constant
pub fn uint_max(bit_width: u32) -> Constant
See BigInt::uint_max
Trait Implementations§
Source§impl<__D: SpanDecoder> Decodable<__D> for Constant
impl<__D: SpanDecoder> Decodable<__D> for Constant
Source§impl<__E: SpanEncoder> Encodable<__E> for Constant
impl<__E: SpanEncoder> Encodable<__E> for Constant
impl Copy for Constant
impl Eq for Constant
impl StructuralPartialEq for Constant
Auto Trait Implementations§
impl Freeze for Constant
impl RefUnwindSafe for Constant
impl Send for Constant
impl Sync for Constant
impl Unpin for Constant
impl UnwindSafe for Constant
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more