pub trait SubstWith<'db, Term> {
type Output;
// Required methods
fn identity(&self) -> Self::Output;
fn subst_with<'subst>(
&'subst self,
db: &'db dyn Db,
bound_vars: &mut Vec<SymVariable<'db>>,
subst_fns: &mut SubstitutionFns<'_, 'db, Term>,
) -> Self::Output;
}Expand description
Core substitution operation: produce a version of this type
with variables replaced with instances of Term.
Most types implement this for only a single Term, but not all
(see the macro identity_subst).
Required Associated Types§
Required Methods§
Sourcefn subst_with<'subst>(
&'subst self,
db: &'db dyn Db,
bound_vars: &mut Vec<SymVariable<'db>>,
subst_fns: &mut SubstitutionFns<'_, 'db, Term>,
) -> Self::Output
fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, Term>, ) -> Self::Output
Replace self applying the changes from subst_fns.
§Parameters
db, the databasestart_binder, the index of the binder we started from. This always begins asSymBinderIndex::INNERMOSTbut gets incremented as we traverse binders.subst_fns, a struct containing callbacks for substitution