pub struct TyConst {
pub(crate) kind: TyConstKind,
pub id: TyConstId,
}
Expand description
Represents a constant in the type system
Fields§
§kind: TyConstKind
§id: TyConstId
Implementations§
Source§impl TyConst
impl TyConst
pub fn new(kind: TyConstKind, id: TyConstId) -> TyConst
Sourcepub fn kind(&self) -> &TyConstKind
pub fn kind(&self) -> &TyConstKind
Retrieve the constant kind.
Sourcepub fn try_from_target_usize(val: u64) -> Result<Self, Error>
pub fn try_from_target_usize(val: u64) -> Result<Self, Error>
Creates an interned usize constant.
Sourcepub fn eval_target_usize(&self) -> Result<u64, Error>
pub fn eval_target_usize(&self) -> Result<u64, Error>
Try to evaluate to a target usize
.
Trait Implementations§
Source§impl Visitable for TyConst
impl Visitable for TyConst
fn visit<V: Visitor>(&self, visitor: &mut V) -> ControlFlow<V::Break>
fn super_visit<V: Visitor>(&self, visitor: &mut V) -> ControlFlow<V::Break>
impl Eq for TyConst
impl StructuralPartialEq for TyConst
Auto Trait Implementations§
impl Freeze for TyConst
impl RefUnwindSafe for TyConst
impl Send for TyConst
impl Sync for TyConst
impl Unpin for TyConst
impl UnwindSafe for TyConst
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,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 80 bytes