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§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)