# Trait rustc_middle::ty::inherent::EvaluationCache

source ·

    pub trait EvaluationCache<I>where
        I: Interner,{
        // Required methods
        fn insert(
            &self,
            tcx: I,
            key: Canonical<I, QueryInput<I, <I as Interner>::Predicate>>,
            proof_tree: Option<<I as Interner>::CanonicalGoalEvaluationStepRef>,
            additional_depth: usize,
            encountered_overflow: bool,
            cycle_participants: HashSet<Canonical<I, QueryInput<I, <I as Interner>::Predicate>>, BuildHasherDefault<FxHasher>>,
            dep_node: <I as Interner>::DepNodeIndex,
            result: Result<Canonical<I, Response<I>>, NoSolution>,
        );
        fn get(
            &self,
            tcx: I,
            key: Canonical<I, QueryInput<I, <I as Interner>::Predicate>>,
            stack_entries: impl IntoIterator<Item = Canonical<I, QueryInput<I, <I as Interner>::Predicate>>>,
            available_depth: usize,
        ) -> Option<CacheData<I>>;
    }

## Required Methods§

source

#### fn insert( &self, tcx: I, key: Canonical<I, QueryInput<I, <I as Interner>::Predicate>>, proof_tree: Option<<I as Interner>::CanonicalGoalEvaluationStepRef>, additional_depth: usize, encountered_overflow: bool, cycle_participants: HashSet<Canonical<I, QueryInput<I, <I as Interner>::Predicate>>, BuildHasherDefault<FxHasher>>, dep_node: <I as Interner>::DepNodeIndex, result: Result<Canonical<I, Response<I>>, NoSolution>, )

Insert a final result into the global cache.

source

#### fn get( &self, tcx: I, key: Canonical<I, QueryInput<I, <I as Interner>::Predicate>>, stack_entries: impl IntoIterator<Item = Canonical<I, QueryInput<I, <I as Interner>::Predicate>>>, available_depth: usize, ) -> Option<CacheData<I>>

Try to fetch a cached result, checking the recursion limit and handling root goals of coinductive cycles.

If this returns `Some` the cache result can be used.

## Object Safety§

This trait is not object safe.

## Implementors§

source§

### impl<'tcx> EvaluationCache<TyCtxt<'tcx>> for &'tcx EvaluationCache<'tcx>