Trait ra_ap_base_db::SourceDatabase
source · 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§
sourcefn parse(&self, file_id: FileId) -> Parse<SourceFile>
fn parse(&self, file_id: FileId) -> Parse<SourceFile>
Parses the file into the syntax tree.
sourcefn crate_graph(&self) -> Arc<CrateGraph>
fn crate_graph(&self) -> Arc<CrateGraph>
The crate graph.
sourcefn set_crate_graph(&mut self, value__: Arc<CrateGraph>)
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.
sourcefn set_crate_graph_with_durability(
&mut self,
value__: Arc<CrateGraph>,
durability__: Durability
)
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.
fn data_layout(&self, krate: CrateId) -> TargetLayoutLoadResult
sourcefn set_data_layout(&mut self, krate: CrateId, value__: TargetLayoutLoadResult)
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.
sourcefn set_data_layout_with_durability(
&mut self,
krate: CrateId,
value__: TargetLayoutLoadResult,
durability__: Durability
)
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.
fn toolchain(&self, krate: CrateId) -> Option<Version>
sourcefn set_toolchain(&mut self, krate: CrateId, value__: Option<Version>)
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.
sourcefn set_toolchain_with_durability(
&mut self,
krate: CrateId,
value__: Option<Version>,
durability__: Durability
)
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.