Struct stable_mir::ty::TyConst
source · 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,
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
)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