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

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§

default 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,

§

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>,

§

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>,

§

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.