[−][src]Struct cranelift_codegen_meta::cdsl::typevar::TypeVar
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]
name: impl Into<String>,
doc: impl Into<String>,
type_set: TypeSet
) -> Self
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.
fn deref(&self) -> &Self::Target[src]
impl Eq for TypeVar[src]
impl Hash for TypeVar[src]
fn hash<H: Hasher>(&self, h: &mut H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<'_> Into<OperandKind> for &'_ TypeVar[src]
fn into(self) -> OperandKind[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,