Trait rustc_query_system::query::QueryCache [−][src]
Associated Types
Loading content...Required methods
fn lookup<'s, R, OnHit>(
&self,
state: &'s QueryCacheStore<Self>,
key: &Self::Key,
on_hit: OnHit
) -> Result<R, QueryLookup> where
OnHit: FnOnce(&Self::Stored, DepNodeIndex) -> R, [src]
&self,
state: &'s QueryCacheStore<Self>,
key: &Self::Key,
on_hit: OnHit
) -> Result<R, QueryLookup> where
OnHit: FnOnce(&Self::Stored, DepNodeIndex) -> R,
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.
fn complete(
&self,
lock_sharded_storage: &mut Self::Sharded,
key: Self::Key,
value: Self::Value,
index: DepNodeIndex
) -> Self::Stored[src]
&self,
lock_sharded_storage: &mut Self::Sharded,
key: Self::Key,
value: Self::Value,
index: DepNodeIndex
) -> Self::Stored
fn iter<R>(
&self,
shards: &Sharded<Self::Sharded>,
f: impl for<'a> FnOnce(&'a mut dyn Iterator<Item = (&'a Self::Key, &'a Self::Value, DepNodeIndex)>) -> R
) -> R[src]
&self,
shards: &Sharded<Self::Sharded>,
f: impl for<'a> FnOnce(&'a mut dyn Iterator<Item = (&'a Self::Key, &'a Self::Value, DepNodeIndex)>) -> R
) -> R
Implementors
impl<'tcx, K, V: 'tcx> QueryCache for ArenaCache<'tcx, K, V> where
K: Eq + Hash + Clone + Debug,
V: Debug, [src]
K: Eq + Hash + Clone + Debug,
V: Debug,
type Key = K
type Sharded = FxHashMap<K, &'tcx (V, DepNodeIndex)>
fn lookup<'s, R, OnHit>(
&self,
state: &'s QueryCacheStore<Self>,
key: &K,
on_hit: OnHit
) -> Result<R, QueryLookup> where
OnHit: FnOnce(&&'tcx V, DepNodeIndex) -> R, [src]
&self,
state: &'s QueryCacheStore<Self>,
key: &K,
on_hit: OnHit
) -> Result<R, QueryLookup> where
OnHit: FnOnce(&&'tcx V, DepNodeIndex) -> R,
fn complete(
&self,
lock_sharded_storage: &mut Self::Sharded,
key: K,
value: V,
index: DepNodeIndex
) -> Self::Stored[src]
&self,
lock_sharded_storage: &mut Self::Sharded,
key: K,
value: V,
index: DepNodeIndex
) -> Self::Stored
fn iter<R>(
&self,
shards: &Sharded<Self::Sharded>,
f: impl for<'a> FnOnce(&'a mut dyn Iterator<Item = (&'a K, &'a V, DepNodeIndex)>) -> R
) -> R[src]
&self,
shards: &Sharded<Self::Sharded>,
f: impl for<'a> FnOnce(&'a mut dyn Iterator<Item = (&'a K, &'a V, DepNodeIndex)>) -> R
) -> R
impl<K, V> QueryCache for DefaultCache<K, V> where
K: Eq + Hash + Clone + Debug,
V: Clone + Debug, [src]
K: Eq + Hash + Clone + Debug,
V: Clone + Debug,
type Key = K
type Sharded = FxHashMap<K, (V, DepNodeIndex)>
fn lookup<'s, R, OnHit>(
&self,
state: &'s QueryCacheStore<Self>,
key: &K,
on_hit: OnHit
) -> Result<R, QueryLookup> where
OnHit: FnOnce(&V, DepNodeIndex) -> R, [src]
&self,
state: &'s QueryCacheStore<Self>,
key: &K,
on_hit: OnHit
) -> Result<R, QueryLookup> where
OnHit: FnOnce(&V, DepNodeIndex) -> R,
fn complete(
&self,
lock_sharded_storage: &mut Self::Sharded,
key: K,
value: V,
index: DepNodeIndex
) -> Self::Stored[src]
&self,
lock_sharded_storage: &mut Self::Sharded,
key: K,
value: V,
index: DepNodeIndex
) -> Self::Stored
fn iter<R>(
&self,
shards: &Sharded<Self::Sharded>,
f: impl for<'a> FnOnce(&'a mut dyn Iterator<Item = (&'a K, &'a V, DepNodeIndex)>) -> R
) -> R[src]
&self,
shards: &Sharded<Self::Sharded>,
f: impl for<'a> FnOnce(&'a mut dyn Iterator<Item = (&'a K, &'a V, DepNodeIndex)>) -> R
) -> R