pub struct Term {
pub id: TermId,
pub decl_pos: Pos,
pub name: Sym,
pub arg_tys: Vec<TypeId>,
pub ret_ty: TypeId,
pub kind: TermKind,
}
Expand description
A term.
Maps parameter types to result types if this is a constructor term, or result types to parameter types if this is an extractor term. Or both if this term can be either a constructor or an extractor.
Fields§
§id: TermId
This term’s id.
decl_pos: Pos
The source position where this term was declared.
name: Sym
The name of this term.
arg_tys: Vec<TypeId>
The parameter types to this term.
ret_ty: TypeId
The result types of this term.
kind: TermKind
The kind of this term.
Implementations§
Source§impl Term
impl Term
Sourcepub fn is_enum_variant(&self) -> bool
pub fn is_enum_variant(&self) -> bool
Is this term an enum variant?
Sourcepub fn is_partial(&self) -> bool
pub fn is_partial(&self) -> bool
Is this term partial?
Sourcepub fn has_constructor(&self) -> bool
pub fn has_constructor(&self) -> bool
Does this term have a constructor?
Sourcepub fn has_extractor(&self) -> bool
pub fn has_extractor(&self) -> bool
Does this term have an extractor?
Sourcepub fn has_external_extractor(&self) -> bool
pub fn has_external_extractor(&self) -> bool
Is this term’s extractor external?
Sourcepub fn has_external_constructor(&self) -> bool
pub fn has_external_constructor(&self) -> bool
Is this term’s constructor external?
Sourcepub fn extractor_sig(&self, tyenv: &TypeEnv) -> Option<ExternalSig>
pub fn extractor_sig(&self, tyenv: &TypeEnv) -> Option<ExternalSig>
Get this term’s extractor’s external function signature, if any.
Sourcepub fn constructor_sig(&self, tyenv: &TypeEnv) -> Option<ExternalSig>
pub fn constructor_sig(&self, tyenv: &TypeEnv) -> Option<ExternalSig>
Get this term’s constructor’s external function signature, if any.
Trait Implementations§
impl Eq for Term
impl StructuralPartialEq for Term
Auto Trait Implementations§
impl Freeze for Term
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnwindSafe for Term
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