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§

source

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§

source

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§

source§

impl<I> TypeSuperFoldable<I> for Const<I>
where I: Interner,

source§

impl<I> TypeSuperFoldable<I> for Lifetime<I>
where I: Interner,

source§

impl<I> TypeSuperFoldable<I> for Ty<I>
where I: Interner,

“Super fold” for a type invokes te more detailed callbacks on the type

source§

impl<I: Interner> TypeSuperFoldable<I> for Goal<I>

Superfold folds recursively.

source§

impl<I: Interner> TypeSuperFoldable<I> for ProgramClause<I>

source§

impl<I: Interner> TypeSuperFoldable<I> for ProgramClauseData<I>