pub trait Subst<'db>: SubstWith<'db, Self::GenericTerm> + Debug {
type GenericTerm: Copy + HasKind<'db> + Debug + FromVar<'db>;
// Provided methods
fn subst_vars(
&self,
db: &'db dyn Db,
map: &Map<SymVariable<'db>, Self::GenericTerm>,
) -> Self::Output { ... }
fn subst_var(
&self,
db: &'db dyn Db,
var: SymVariable<'db>,
term: Self::GenericTerm,
) -> Self::Output { ... }
fn resolve_infer_var(
&self,
db: &'db dyn Db,
bound_vars: &mut Vec<SymVariable<'db>>,
op: impl FnMut(InferVarIndex) -> Option<Self::GenericTerm>,
) -> Self::Output { ... }
}Expand description
A type implemented by terms that can be substituted.
Required Associated Types§
Provided Methods§
Sourcefn subst_vars(
&self,
db: &'db dyn Db,
map: &Map<SymVariable<'db>, Self::GenericTerm>,
) -> Self::Output
fn subst_vars( &self, db: &'db dyn Db, map: &Map<SymVariable<'db>, Self::GenericTerm>, ) -> Self::Output
Returns a version of self where universal free variables
have been replaced by the corresponding entry in terms.
If a variable is not present in terms it is not substituted.
Sourcefn subst_var(
&self,
db: &'db dyn Db,
var: SymVariable<'db>,
term: Self::GenericTerm,
) -> Self::Output
fn subst_var( &self, db: &'db dyn Db, var: SymVariable<'db>, term: Self::GenericTerm, ) -> Self::Output
Replace the variable var with term.
Sourcefn resolve_infer_var(
&self,
db: &'db dyn Db,
bound_vars: &mut Vec<SymVariable<'db>>,
op: impl FnMut(InferVarIndex) -> Option<Self::GenericTerm>,
) -> Self::Output
fn resolve_infer_var( &self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, op: impl FnMut(InferVarIndex) -> Option<Self::GenericTerm>, ) -> Self::Output
Replace all inference variables with whatever is returned by op;
if op returns None, the inference variable is left unchanged.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.