Module query

Source

Modules§

caches 🔒
config 🔒
Query configuration and description traits.
job 🔒
plumbing 🔒
The implementation of the query system itself. This defines the macros that generate the actual methods on tcx which find and execute the provider, manage the caches, and so forth.

Structs§

CycleError
DefIdCache
In-memory cache for queries whose key is a DefId.
DefaultCache
In-memory cache for queries whose keys aren’t suitable for any of the more specialized kinds of cache. Backed by a sharded hashmap.
QueryInfo
Represents a span and a query key.
QueryJob
Represents an active query job.
QueryJobId
A value uniquely identifying an active query job.
QueryJobInfo
QueryStackDeferred
Track a ‘side effect’ for a particular query. This is used to hold a closure which can create QueryStackFrameExtra.
QueryStackFrame
Description of a frame in the query stack.
QueryStackFrameExtra
QueryState
SingleCache
In-memory cache for queries whose key type only has one value (e.g. ()). The cache therefore only needs to store one query return value.
VecCache
In-memory cache for queries whose keys are densely-numbered IDs (e.g CrateNum, LocalDefId), and can therefore be used as indices into a dense vector of cached values.

Enums§

QueryMode
QuerySideEffect
Tracks ‘side effects’ for a particular query. This struct is saved to disk along with the query result, and loaded from disk if we mark the query as green. This allows us to ‘replay’ changes to global state that would otherwise only occur if we actually executed the query method.

Traits§

QueryCache
Trait for types that serve as an in-memory cache for query results, for a given key (argument) type and value (return) type.
QueryConfig
QueryContext

Functions§

break_query_cycles
Detects query cycles by using depth first search over all active query jobs. If a query cycle is found it will break the cycle by finding an edge which uses a query latch and then resuming that waiter. There may be multiple cycles involved in a deadlock, so this searches all active queries for cycles before finally resuming all the waiters at once.
force_query
get_query_incr
get_query_non_incr
print_query_stack
report_cycle
try_get_cached
Checks whether there is already a value for this key in the in-memory query cache, returning that value if present.

Type Aliases§

HashResult
QueryMap