base_db

Trait SourceDatabase

source
pub trait SourceDatabase:
    Database
    + HasQueryGroup<SourceDatabaseStorage>
    + FileLoader
    + Debug {
Show 13 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 crate_workspace_data( &self, ) -> Arc<FxHashMap<CrateId, Arc<CrateWorkspaceData>>>; fn set_crate_workspace_data( &mut self, value__: Arc<FxHashMap<CrateId, Arc<CrateWorkspaceData>>>, ); fn set_crate_workspace_data_with_durability( &mut self, value__: Arc<FxHashMap<CrateId, Arc<CrateWorkspaceData>>>, 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 compressed_file_text(&self, file_id: FileId) -> Arc<[u8]>

source

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.

source

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.

source

fn file_text(&self, file_id: FileId) -> Arc<str>

Text of the file.

source

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

Parses the file into the syntax tree.

source

fn parse_errors(&self, file_id: EditionedFileId) -> Option<Arc<[SyntaxError]>>

Returns the set of errors obtained from parsing the file including validation errors.

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 crate_workspace_data( &self, ) -> Arc<FxHashMap<CrateId, Arc<CrateWorkspaceData>>>

source

fn set_crate_workspace_data( &mut self, value__: Arc<FxHashMap<CrateId, Arc<CrateWorkspaceData>>>, )

Set the value of the crate_workspace_data input.

See crate_workspace_data 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_workspace_data_with_durability( &mut self, value__: Arc<FxHashMap<CrateId, Arc<CrateWorkspaceData>>>, durability__: Durability, )

Set the value of the crate_workspace_data 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_workspace_data 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>,