Struct TypeId

Source
pub struct TypeId(pub u32);
Expand description

An interned Id for ArrayDef.

Tuple Fields§

§0: u32

Implementations§

Source§

impl TypeId

Source

pub fn data(self, db: &dyn MirDb) -> Rc<Type>

Source

pub fn analyzer_ty(self, db: &dyn MirDb) -> Option<TypeId>

Source

pub fn projection_ty(self, db: &dyn MirDb, access: &Value) -> TypeId

Source

pub fn deref(self, db: &dyn MirDb) -> TypeId

Source

pub fn make_sptr(self, db: &dyn MirDb) -> TypeId

Source

pub fn make_mptr(self, db: &dyn MirDb) -> TypeId

Source

pub fn projection_ty_imm(self, db: &dyn MirDb, index: usize) -> TypeId

Source

pub fn aggregate_field_num(self, db: &dyn MirDb) -> usize

Source

pub fn enum_disc_type(self, db: &dyn MirDb) -> TypeId

Source

pub fn enum_data_offset(self, db: &dyn MirDb, slot_size: usize) -> usize

Source

pub fn enum_variant_type( self, db: &dyn MirDb, variant_id: EnumVariantId, ) -> TypeId

Source

pub fn index_from_fname(self, db: &dyn MirDb, fname: &str) -> BigInt

Source

pub fn is_primitive(self, db: &dyn MirDb) -> bool

Source

pub fn is_integral(self, db: &dyn MirDb) -> bool

Source

pub fn is_address(self, db: &dyn MirDb) -> bool

Source

pub fn is_unit(self, db: &dyn MirDb) -> bool

Source

pub fn is_enum(self, db: &dyn MirDb) -> bool

Source

pub fn is_signed(self, db: &dyn MirDb) -> bool

Source

pub fn size_of(self, db: &dyn MirDb, slot_size: usize) -> usize

Returns size of the type in bytes.

Source

pub fn is_zero_sized(self, db: &dyn MirDb) -> bool

Source

pub fn align_of(self, db: &dyn MirDb, slot_size: usize) -> usize

Source

pub fn aggregate_elem_offset<T>( self, db: &dyn MirDb, elem_idx: T, slot_size: usize, ) -> usize
where T: ToPrimitive,

Returns an offset of the element of aggregate type.

Source

pub fn is_aggregate(self, db: &dyn MirDb) -> bool

Source

pub fn is_struct(self, db: &dyn MirDb) -> bool

Source

pub fn is_array(self, db: &dyn MirDb) -> bool

Source

pub fn is_string(self, db: &dyn MirDb) -> bool

Source

pub fn is_ptr(self, db: &dyn MirDb) -> bool

Source

pub fn is_mptr(self, db: &dyn MirDb) -> bool

Source

pub fn is_sptr(self, db: &dyn MirDb) -> bool

Source

pub fn is_map(self, db: &dyn MirDb) -> bool

Source

pub fn is_contract(self, db: &dyn MirDb) -> bool

Source

pub fn array_elem_size(self, db: &dyn MirDb, slot_size: usize) -> usize

Source

pub fn print<W: Write>(&self, db: &dyn MirDb, w: &mut W) -> Result

Source

pub fn as_string(&self, db: &dyn MirDb) -> String

Trait Implementations§

Source§

impl Clone for TypeId

Source§

fn clone(&self) -> TypeId

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TypeId

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for TypeId

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl InternKey for TypeId

Source§

fn from_intern_id(v: InternId) -> Self

Create an instance of the intern-key from a u32 value.
Source§

fn as_intern_id(&self) -> InternId

Extract the u32 with which the intern-key was created.
Source§

impl PartialEq for TypeId

Source§

fn eq(&self, other: &TypeId) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PrettyPrint for TypeId

Source§

fn pretty_print<W: Write>( &self, db: &dyn MirDb, _store: &BodyDataStore, w: &mut W, ) -> Result

Source§

fn pretty_string(&self, db: &dyn MirDb, store: &BodyDataStore) -> String

Source§

impl Copy for TypeId

Source§

impl Eq for TypeId

Source§

impl StructuralPartialEq for TypeId

Auto Trait Implementations§

§

impl Freeze for TypeId

§

impl RefUnwindSafe for TypeId

§

impl Send for TypeId

§

impl Sync for TypeId

§

impl Unpin for TypeId

§

impl UnwindSafe for TypeId

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.