Struct cranelift_isle::sema::Term
source · [−]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
sourceimpl 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 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 StructuralEq for Term
impl StructuralPartialEq for Term
Auto Trait Implementations
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnwindSafe for Term
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more