Trait gluon_check::substitution::Substitutable
source · pub trait Substitutable: Sized {
type Variable: Variable;
type Factory: VariableFactory<Variable = Self::Variable>;
type Interner: Default;
// Required methods
fn from_variable(subs: &Substitution<Self>, x: Self::Variable) -> Self;
fn into_variable(&mut self, x: Self::Variable);
fn is_unique(self_: &Self) -> bool;
fn get_var(&self) -> Option<&Self::Variable>;
fn traverse<'a, F>(&'a self, f: &mut F)
where F: Walker<'a, Self>;
fn instantiate(&self, subs: &Substitution<Self>) -> Self;
// Provided methods
fn get_id(&self) -> Option<u32> { ... }
fn contains_variables(&self) -> bool { ... }
}
Expand description
Trait implemented on types which may contain substitutable variables
Required Associated Types§
type Variable: Variable
type Factory: VariableFactory<Variable = Self::Variable>
type Interner: Default
Required Methods§
sourcefn from_variable(subs: &Substitution<Self>, x: Self::Variable) -> Self
fn from_variable(subs: &Substitution<Self>, x: Self::Variable) -> Self
Constructs a new object from its variable type
fn into_variable(&mut self, x: Self::Variable)
fn is_unique(self_: &Self) -> bool
sourcefn get_var(&self) -> Option<&Self::Variable>
fn get_var(&self) -> Option<&Self::Variable>
Retrieves the variable if self
is a variable otherwise returns None
fn traverse<'a, F>(&'a self, f: &mut F)where
F: Walker<'a, Self>,
fn instantiate(&self, subs: &Substitution<Self>) -> Self
Provided Methods§
Object Safety§
This trait is not object safe.