cranelift_isle::sema

Struct 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

Source

pub fn ty(&self) -> TypeId

Get this term’s type.

Source

pub fn is_enum_variant(&self) -> bool

Is this term an enum variant?

Source

pub fn is_partial(&self) -> bool

Is this term partial?

Source

pub fn has_constructor(&self) -> bool

Does this term have a constructor?

Source

pub fn has_extractor(&self) -> bool

Does this term have an extractor?

Source

pub fn has_external_extractor(&self) -> bool

Is this term’s extractor external?

Source

pub fn has_external_constructor(&self) -> bool

Is this term’s constructor external?

Source

pub fn extractor_sig(&self, tyenv: &TypeEnv) -> Option<ExternalSig>

Get this term’s extractor’s external function signature, if any.

Source

pub fn constructor_sig(&self, tyenv: &TypeEnv) -> Option<ExternalSig>

Get this term’s constructor’s external function signature, if any.

Trait Implementations§

Source§

impl Clone for Term

Source§

fn clone(&self) -> Term

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 Term

Source§

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

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

impl PartialEq for Term

Source§

fn eq(&self, other: &Term) -> 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 Eq for Term

Source§

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> 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 T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
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.