Skip to main content

QueryContext

Trait QueryContext 

Source
pub trait QueryContext<'tcx>: HasDepContext {
    // Required methods
    fn jobserver_proxy(&self) -> &Proxy;
    fn next_job_id(self) -> QueryJobId;
    fn current_query_job(self) -> Option<QueryJobId>;
    fn collect_active_jobs_from_all_queries(
        self,
        require_complete: bool,
    ) -> Result<QueryMap<'tcx>, QueryMap<'tcx>>;
    fn load_side_effect(
        self,
        prev_dep_node_index: SerializedDepNodeIndex,
    ) -> Option<QuerySideEffect>;
    fn store_side_effect(
        self,
        dep_node_index: DepNodeIndex,
        side_effect: QuerySideEffect,
    );
    fn start_query<R>(
        self,
        token: QueryJobId,
        depth_limit: bool,
        compute: impl FnOnce() -> R,
    ) -> R;
}

Required Methods§

Source

fn jobserver_proxy(&self) -> &Proxy

Gets a jobserver reference which is used to release then acquire a token while waiting on a query.

Source

fn next_job_id(self) -> QueryJobId

Source

fn current_query_job(self) -> Option<QueryJobId>

Get the query information from the TLS context.

Source

fn collect_active_jobs_from_all_queries( self, require_complete: bool, ) -> Result<QueryMap<'tcx>, QueryMap<'tcx>>

Source

fn load_side_effect( self, prev_dep_node_index: SerializedDepNodeIndex, ) -> Option<QuerySideEffect>

Load a side effect associated to the node in the previous session.

Source

fn store_side_effect( self, dep_node_index: DepNodeIndex, side_effect: QuerySideEffect, )

Register a side effect for the given node, for use in next session.

Source

fn start_query<R>( self, token: QueryJobId, depth_limit: bool, compute: impl FnOnce() -> R, ) -> R

Executes a job by changing the ImplicitCtxt to point to the new query job while it executes.

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§