pub trait WithGlobalCacheExt<'tcx>: BaseState<'tcx> {
// Provided methods
fn with_global_cache<T>(
&self,
f: impl FnOnce(&mut GlobalCache<'tcx>) -> T,
) -> T { ... }
fn with_item_cache<T>(
&self,
def_id: RDefId,
f: impl FnOnce(&mut ItemCache<'tcx>) -> T,
) -> T { ... }
}
Provided Methods§
sourcefn with_global_cache<T>(&self, f: impl FnOnce(&mut GlobalCache<'tcx>) -> T) -> T
fn with_global_cache<T>(&self, f: impl FnOnce(&mut GlobalCache<'tcx>) -> T) -> T
Access the global cache. You must not call sinto
within this function as this will likely
result in BorrowMut
panics.
sourcefn with_item_cache<T>(
&self,
def_id: RDefId,
f: impl FnOnce(&mut ItemCache<'tcx>) -> T,
) -> T
fn with_item_cache<T>( &self, def_id: RDefId, f: impl FnOnce(&mut ItemCache<'tcx>) -> T, ) -> T
Access the cache for a given item. You must not call sinto
within this function as this
will likely result in BorrowMut
panics.
Object Safety§
This trait is not object safe.