WithItemCacheExt

Trait WithItemCacheExt 

Source
pub trait WithItemCacheExt<'tcx>: UnderOwnerState<'tcx> {
    // Provided methods
    fn with_cache<T>(&self, f: impl FnOnce(&mut ItemCache<'tcx>) -> T) -> T { ... }
    fn with_predicate_searcher<T>(
        &self,
        f: impl FnOnce(&mut PredicateSearcher<'tcx>) -> T,
    ) -> T { ... }
}

Provided Methods§

Source

fn with_cache<T>(&self, f: impl FnOnce(&mut ItemCache<'tcx>) -> T) -> T

Access the cache for the current item. You must not call sinto within this function as this will likely result in BorrowMut panics.

Source

fn with_predicate_searcher<T>( &self, f: impl FnOnce(&mut PredicateSearcher<'tcx>) -> T, ) -> T

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.

Implementors§

Source§

impl<'tcx, S: UnderOwnerState<'tcx>> WithItemCacheExt<'tcx> for S