pub struct Type<'cx> { /* private fields */ }Expand description
An expression representing a type
Implementations§
Source§impl<'cx> Type<'cx>
impl<'cx> Type<'cx>
pub fn new(val: Nir<'cx>, univ: Universe) -> Self
Sourcepub fn new_infer_universe(
env: &TyEnv<'cx>,
val: Nir<'cx>,
) -> Result<Self, TypeError>
pub fn new_infer_universe( env: &TyEnv<'cx>, val: Nir<'cx>, ) -> Result<Self, TypeError>
Creates a new Type and infers its universe by re-typechecking its value. TODO: ideally avoid this function altogether. Would need to store types in RecordType and PiClosure.
pub fn from_const(c: Const) -> Self
pub fn from_builtin(cx: Ctxt<'cx>, b: Builtin) -> Self
pub fn to_nir(&self) -> Nir<'cx>
pub fn as_nir(&self) -> &Nir<'cx>
pub fn into_nir(self) -> Nir<'cx>
pub fn as_const(&self) -> Option<Const>
pub fn kind(&self) -> &NirKind<'cx>
pub fn to_hir(&self, venv: VarEnv) -> Hir<'cx>
pub fn to_expr_tyenv(&self, tyenv: &TyEnv<'cx>) -> Expr
Trait Implementations§
impl<'cx> Eq for Type<'cx>
impl<'cx> StructuralPartialEq for Type<'cx>
Auto Trait Implementations§
impl<'cx> Freeze for Type<'cx>
impl<'cx> !RefUnwindSafe for Type<'cx>
impl<'cx> !Send for Type<'cx>
impl<'cx> !Sync for Type<'cx>
impl<'cx> Unpin for Type<'cx>
impl<'cx> !UnwindSafe for Type<'cx>
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.