pub fn try_get_cached<'a, Tcx, C, R, OnHit>(
    tcx: Tcx,
    cache: &'a C,
    key: &C::Key,
    on_hit: OnHit
) -> Result<R, ()>where
    C: QueryCache,
    Tcx: DepContext,
    OnHit: FnOnce(&C::Stored) -> R,
Expand description

Checks if the query is already computed and in the cache. It returns the shard index and a lock guard to the shard, which will be used if the query is not in the cache and we need to compute it.