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

Fields§

§content: Rc<RefCell<TypeVarContent>>

Implementations§

source§

impl TypeVar

source

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

source

pub fn new_singleton(value_type: ValueType) -> Self

source

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

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

source

pub fn get_typeset(&self) -> TypeSet

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.

source

pub fn get_raw_typeset(&self) -> &TypeSet

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

source

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

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

source

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

Get the free type variable controlling this one.

source

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

Create a type variable that is a function of another.

source

pub fn lane_of(&self) -> TypeVar

source

pub fn as_truthy(&self) -> TypeVar

source

pub fn half_width(&self) -> TypeVar

source

pub fn double_width(&self) -> TypeVar

source

pub fn split_lanes(&self) -> TypeVar

source

pub fn merge_lanes(&self) -> TypeVar

source

pub fn dynamic_to_vector(&self) -> TypeVar

source

pub fn narrower(&self) -> TypeVar

Make a new TypeVar that includes all types narrower than self.

source

pub fn wider(&self) -> TypeVar

Make a new TypeVar that includes all types wider than self.

Trait Implementations§

source§

impl Clone for TypeVar

source§

fn clone(&self) -> TypeVar

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 TypeVar

source§

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

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

impl Deref for TypeVar

§

type Target = TypeVarContent

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl From<&TypeVar> for OperandKind

source§

fn from(type_var: &TypeVar) -> Self

Converts to this type from the input type.
source§

impl From<&TypeVar> for TypeVar

source§

fn from(type_var: &TypeVar) -> Self

Converts to this type from the input type.
source§

impl From<ValueType> for TypeVar

source§

fn from(value_type: ValueType) -> Self

Converts to this type from the input type.
source§

impl Hash for TypeVar

source§

fn hash<H: Hasher>(&self, h: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<TypeVar> for TypeVar

source§

fn eq(&self, other: &TypeVar) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for TypeVar

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§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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 Twhere 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 Twhere 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 Twhere 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.