Trait ra_ap_base_db::SourceDatabase
source · pub trait SourceDatabase:
Database
+ HasQueryGroup<SourceDatabaseStorage>
+ FileLoader
+ Debug {
Show 16 methods
// Required methods
fn compressed_file_text(&self, file_id: FileId) -> Arc<[u8]>;
fn set_compressed_file_text(&mut self, file_id: FileId, value__: Arc<[u8]>);
fn set_compressed_file_text_with_durability(
&mut self,
file_id: FileId,
value__: Arc<[u8]>,
durability__: Durability,
);
fn file_text(&self, file_id: FileId) -> Arc<str>;
fn parse(&self, file_id: EditionedFileId) -> Parse<SourceFile>;
fn parse_errors(
&self,
file_id: EditionedFileId,
) -> Option<Arc<[SyntaxError]>>;
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§
fn compressed_file_text(&self, file_id: FileId) -> Arc<[u8]>
sourcefn set_compressed_file_text(&mut self, file_id: FileId, value__: Arc<[u8]>)
fn set_compressed_file_text(&mut self, file_id: FileId, value__: Arc<[u8]>)
Set the value of the compressed_file_text input.
See compressed_file_text for details.
Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.
sourcefn set_compressed_file_text_with_durability(
&mut self,
file_id: FileId,
value__: Arc<[u8]>,
durability__: Durability,
)
fn set_compressed_file_text_with_durability( &mut self, file_id: FileId, value__: Arc<[u8]>, durability__: Durability, )
Set the value of the compressed_file_text 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 compressed_file_text for details.
Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.
sourcefn parse(&self, file_id: EditionedFileId) -> Parse<SourceFile>
fn parse(&self, file_id: EditionedFileId) -> Parse<SourceFile>
Parses the file into the syntax tree.
sourcefn parse_errors(&self, file_id: EditionedFileId) -> Option<Arc<[SyntaxError]>>
fn parse_errors(&self, file_id: EditionedFileId) -> Option<Arc<[SyntaxError]>>
Returns the set of errors obtained from parsing the file including validation errors.
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.