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 data_layout(&self, krate: CrateId) -> TargetLayoutLoadResult;
    fn set_data_layout(
        &mut self,
        krate: CrateId,
        value__: TargetLayoutLoadResult
    );
    fn set_data_layout_with_durability(
        &mut self,
        krate: CrateId,
        value__: TargetLayoutLoadResult,
        durability__: Durability
    );
    fn toolchain(&self, krate: CrateId) -> Option<Version>;
    fn set_toolchain(&mut self, krate: CrateId, value__: Option<Version>);
    fn set_toolchain_with_durability(
        &mut self,
        krate: CrateId,
        value__: Option<Version>,
        durability__: Durability
    );
    fn toolchain_channel(&self, krate: CrateId) -> Option<ReleaseChannel>;
}
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>

Parses the file into the syntax tree.

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 with a specific durability instead of the default of Durability::LOW. You can use Durability::MAX to 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 data_layout(&self, krate: CrateId) -> TargetLayoutLoadResult

source

fn set_data_layout(&mut self, krate: CrateId, value__: TargetLayoutLoadResult)

Set the value of the data_layout input.

See data_layout for details.

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

source

fn set_data_layout_with_durability( &mut self, krate: CrateId, value__: TargetLayoutLoadResult, durability__: Durability )

Set the value of the data_layout input with a specific durability instead of the default of Durability::LOW. You can use Durability::MAX to promise that its value will never change again.

See data_layout for details.

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

source

fn toolchain(&self, krate: CrateId) -> Option<Version>

source

fn set_toolchain(&mut self, krate: CrateId, value__: Option<Version>)

Set the value of the toolchain input.

See toolchain for details.

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

source

fn set_toolchain_with_durability( &mut self, krate: CrateId, value__: Option<Version>, durability__: Durability )

Set the value of the toolchain input with a specific durability instead of the default of Durability::LOW. You can use Durability::MAX to promise that its value will never change again.

See toolchain for details.

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

source

fn toolchain_channel(&self, krate: CrateId) -> Option<ReleaseChannel>

Implementors§

source§

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