Trait rustc::middle::typeck::infer::unify::UnifyKey[src]
pub trait UnifyKey<V>: Clone + Show + PartialEq + Repr {
fn index(&self) -> uint;
fn from_index(u: uint) -> Self;
fn unification_table<'v>(infcx: &'v InferCtxt) -> &'v RefCell<UnificationTable<Self, V>>;
fn tag(k: Option<Self>) -> &'static str;
}This trait is implemented by any type that can serve as a type
variable. We call such variables unification keys. For example,
this trait is implemented by TyVid, which represents normal
type variables, and IntVid, which represents integral variables.
Each key type has an associated value type V. For example,
for TyVid, this is Bounds<ty::t>, representing a pair of
upper- and lower-bound types.
Implementations of this trait are at the end of this file.
Required Methods
fn index(&self) -> uint
fn from_index(u: uint) -> Self
fn unification_table<'v>(infcx: &'v InferCtxt) -> &'v RefCell<UnificationTable<Self, V>>
Given an inference context, returns the unification table appropriate to this key type.