pub trait SourceDatabase: Database + HasQueryGroup<SourceDatabaseStorage> + FileLoader + Debug {
    // Required methods
    fn parse(&self, file_id: FileId) -> Parse<SourceFile>;
    fn crate_graph(&self) -> Arc<CrateGraph>;
    fn set_crate_graph(&mut self, value__: Arc<CrateGraph>);
    fn set_crate_graph_with_durability(
        &mut self,
        value__: Arc<CrateGraph>,
        durability__: Durability
    );
    fn proc_macros(&self) -> Arc<ProcMacros>;
    fn set_proc_macros(&mut self, value__: Arc<ProcMacros>);
    fn set_proc_macros_with_durability(
        &mut self,
        value__: Arc<ProcMacros>,
        durability__: Durability
    );
}
Expand description

Database which stores all significant input facts: source code and project model. Everything else in rust-analyzer is derived from these queries.

Required Methods§

source

fn parse(&self, file_id: FileId) -> Parse<SourceFile>

source

fn crate_graph(&self) -> Arc<CrateGraph>

The crate graph.

source

fn set_crate_graph(&mut self, value__: Arc<CrateGraph>)

Set the value of the crate_graph input.

See crate_graph for details.

Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.

source

fn set_crate_graph_with_durability( &mut self, value__: Arc<CrateGraph>, durability__: Durability )

Set the value of the crate_graph input and promise that its value will never change again.

See crate_graph for details.

Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.

source

fn proc_macros(&self) -> Arc<ProcMacros>

The crate graph.

source

fn set_proc_macros(&mut self, value__: Arc<ProcMacros>)

Set the value of the proc_macros input.

See proc_macros for details.

Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.

source

fn set_proc_macros_with_durability( &mut self, value__: Arc<ProcMacros>, durability__: Durability )

Set the value of the proc_macros input and promise that its value will never change again.

See proc_macros for details.

Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.

Implementors§

source§

impl<DB> SourceDatabase for DB
where DB: FileLoader + Debug + Database + HasQueryGroup<SourceDatabaseStorage>,