[][src]Struct cranelift_codegen_meta::cdsl::typevar::TypeVar

pub(crate) struct TypeVar {
    content: Rc<RefCell<TypeVarContent>>,
}

Fields

content: Rc<RefCell<TypeVarContent>>

Methods

impl TypeVar[src]

pub fn new(
    name: impl Into<String>,
    doc: impl Into<String>,
    type_set: TypeSet
) -> Self
[src]

pub fn new_singleton(value_type: ValueType) -> Self[src]

pub fn copy_from(other: &TypeVar, name: String) -> TypeVar[src]

Get a fresh copy of self, named after name. Can only be called on non-derived typevars.

pub fn get_typeset(&self) -> TypeSet[src]

Returns the typeset for this TV. If the TV is derived, computes it recursively from the derived function and the base's typeset. Note this can't be done non-lazily in the constructor, because the TypeSet of the base may change over time.

pub fn get_raw_typeset(&self) -> &TypeSet[src]

Returns this typevar's type set, assuming this type var has no parent.

pub fn singleton_type(&self) -> Option<ValueType>[src]

If the associated typeset has a single type return it. Otherwise return None.

pub fn free_typevar(&self) -> Option<TypeVar>[src]

Get the free type variable controlling this one.

pub fn derived(&self, derived_func: DerivedFunc) -> TypeVar[src]

Create a type variable that is a function of another.

pub fn lane_of(&self) -> TypeVar[src]

pub fn as_bool(&self) -> TypeVar[src]

pub fn half_width(&self) -> TypeVar[src]

pub fn double_width(&self) -> TypeVar[src]

pub fn half_vector(&self) -> TypeVar[src]

pub fn double_vector(&self) -> TypeVar[src]

pub fn constrain_types_by_ts(&self, type_set: TypeSet)[src]

Constrain the range of types this variable can assume to a subset of those in the typeset ts. May mutate itself if it's not derived, or its parent if it is.

pub fn constrain_types(&self, other: TypeVar)[src]

Constrain the range of types this variable can assume to a subset of those other can assume. May mutate itself if it's not derived, or its parent if it is.

pub fn to_rust_code(&self) -> String[src]

Get a Rust expression that computes the type of this type variable.

Trait Implementations

impl Clone for TypeVar[src]

impl Debug for TypeVar[src]

impl Deref for TypeVar[src]

type Target = TypeVarContent

The resulting type after dereferencing.

impl Eq for TypeVar[src]

impl Hash for TypeVar[src]

impl<'_> Into<OperandKind> for &'_ TypeVar[src]

impl<'_> Into<TypeVar> for &'_ TypeVar[src]

impl Into<TypeVar> for ValueType[src]

impl PartialEq<TypeVar> for TypeVar[src]

Auto Trait Implementations

impl !RefUnwindSafe for TypeVar

impl !Send for TypeVar

impl !Sync for TypeVar

impl Unpin for TypeVar

impl !UnwindSafe for TypeVar

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.