pub trait TyVisitable: Sized + AstVisitable {
// Provided methods
fn visit_vars(&mut self, v: &mut impl VarsVisitor) { ... }
fn substitute(self, generics: &GenericArgs) -> Self { ... }
fn substitute_explicits(self, generics: &GenericArgs) -> Self { ... }
fn substitute_with_self(
self,
generics: &GenericArgs,
self_ref: &TraitRefKind,
) -> Self { ... }
fn move_under_binder(self) -> Self { ... }
fn move_under_binders(self, depth: DeBruijnId) -> Self { ... }
fn move_from_under_binder(self) -> Option<Self> { ... }
fn move_from_under_binders(self, depth: DeBruijnId) -> Option<Self> { ... }
fn visit_db_id<B>(
&mut self,
f: impl FnMut(&mut DeBruijnId) -> ControlFlow<B>,
) -> ControlFlow<B> { ... }
}Expand description
Types that are involved at the type-level and may be substituted around.
Provided Methods§
Sourcefn visit_vars(&mut self, v: &mut impl VarsVisitor)
fn visit_vars(&mut self, v: &mut impl VarsVisitor)
Visit the variables contained in self, as seen from the outside of self. This means
that any variable bound inside self will be skipped, and all the seen De Bruijn indices
will count from the outside of self.
Sourcefn substitute(self, generics: &GenericArgs) -> Self
fn substitute(self, generics: &GenericArgs) -> Self
Substitute the generic variables inside self by replacing them with the provided values.
Note: if self is an item that comes from a TraitDecl, you most likely want to use
substitute_with_self.
Sourcefn substitute_explicits(self, generics: &GenericArgs) -> Self
fn substitute_explicits(self, generics: &GenericArgs) -> Self
Substitute only the type, region and const generic args.
Sourcefn substitute_with_self(
self,
generics: &GenericArgs,
self_ref: &TraitRefKind,
) -> Self
fn substitute_with_self( self, generics: &GenericArgs, self_ref: &TraitRefKind, ) -> Self
Substitute the generic variables as well as the TraitRefKind::Self trait ref.
Sourcefn move_under_binder(self) -> Self
fn move_under_binder(self) -> Self
Move under one binder.
Sourcefn move_under_binders(self, depth: DeBruijnId) -> Self
fn move_under_binders(self, depth: DeBruijnId) -> Self
Move under depth binders.
Sourcefn move_from_under_binder(self) -> Option<Self>
fn move_from_under_binder(self) -> Option<Self>
Move from under one binder.
Sourcefn move_from_under_binders(self, depth: DeBruijnId) -> Option<Self>
fn move_from_under_binders(self, depth: DeBruijnId) -> Option<Self>
Move the value out of depth binders. Returns None if it contains a variable bound in
one of these depth binders.
Sourcefn visit_db_id<B>(
&mut self,
f: impl FnMut(&mut DeBruijnId) -> ControlFlow<B>,
) -> ControlFlow<B>
fn visit_db_id<B>( &mut self, f: impl FnMut(&mut DeBruijnId) -> ControlFlow<B>, ) -> ControlFlow<B>
Visit the de Bruijn ids contained in self, as seen from the outside of self. This means
that any variable bound inside self will be skipped, and all the seen indices will count
from the outside of self.
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.