Trait chalk_ir::fold::TypeSuperFoldable
source · pub trait TypeSuperFoldable<I: Interner>: TypeFoldable<I> {
// Required method
fn try_super_fold_with<E>(
self,
folder: &mut dyn FallibleTypeFolder<I, Error = E>,
outer_binder: DebruijnIndex,
) -> Result<Self, E>;
// Provided method
fn super_fold_with(
self,
folder: &mut dyn TypeFolder<I>,
outer_binder: DebruijnIndex,
) -> Self { ... }
}
Expand description
For types where “fold” invokes a callback on the TypeFolder
, the
TypeSuperFoldable
trait captures the recursive behavior that folds all
the contents of the type.
Required Methods§
sourcefn try_super_fold_with<E>(
self,
folder: &mut dyn FallibleTypeFolder<I, Error = E>,
outer_binder: DebruijnIndex,
) -> Result<Self, E>
fn try_super_fold_with<E>( self, folder: &mut dyn FallibleTypeFolder<I, Error = E>, outer_binder: DebruijnIndex, ) -> Result<Self, E>
Recursively folds the value.
Provided Methods§
sourcefn super_fold_with(
self,
folder: &mut dyn TypeFolder<I>,
outer_binder: DebruijnIndex,
) -> Self
fn super_fold_with( self, folder: &mut dyn TypeFolder<I>, outer_binder: DebruijnIndex, ) -> Self
A convenient alternative to try_super_fold_with
for use with
infallible folders. Do not override this method, to ensure coherence
with try_super_fold_with
.
Object Safety§
This trait is not object safe.
Implementors§
impl<I> TypeSuperFoldable<I> for Const<I>where
I: Interner,
impl<I> TypeSuperFoldable<I> for Lifetime<I>where
I: Interner,
impl<I> TypeSuperFoldable<I> for Ty<I>where
I: Interner,
“Super fold” for a type invokes te more detailed callbacks on the type
impl<I: Interner> TypeSuperFoldable<I> for Goal<I>
Superfold folds recursively.