Trait ra_ap_base_db::SourceDatabaseExt

source ·
pub trait SourceDatabaseExt: Database + HasQueryGroup<SourceDatabaseExtStorage> + SourceDatabase {
    // 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 file_source_root(&self, file_id: FileId) -> SourceRootId;
    fn set_file_source_root(&mut self, file_id: FileId, value__: SourceRootId);
    fn set_file_source_root_with_durability(
        &mut self,
        file_id: FileId,
        value__: SourceRootId,
        durability__: Durability
    );
    fn source_root(&self, id: SourceRootId) -> Arc<SourceRoot>;
    fn set_source_root(&mut self, id: SourceRootId, value__: Arc<SourceRoot>);
    fn set_source_root_with_durability(
        &mut self,
        id: SourceRootId,
        value__: Arc<SourceRoot>,
        durability__: Durability
    );
    fn source_root_crates(&self, id: SourceRootId) -> Arc<[CrateId]>;
}
Expand description

We don’t want to give HIR knowledge of source roots, hence we extract these methods into a separate DB.

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>

source

fn file_source_root(&self, file_id: FileId) -> SourceRootId

Path to a file, relative to the root of its source root. Source root of the file.

source

fn set_file_source_root(&mut self, file_id: FileId, value__: SourceRootId)

Set the value of the file_source_root input.

See file_source_root for details.

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

source

fn set_file_source_root_with_durability( &mut self, file_id: FileId, value__: SourceRootId, durability__: Durability )

Set the value of the file_source_root 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 file_source_root for details.

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

source

fn source_root(&self, id: SourceRootId) -> Arc<SourceRoot>

Contents of the source root.

source

fn set_source_root(&mut self, id: SourceRootId, value__: Arc<SourceRoot>)

Set the value of the source_root input.

See source_root for details.

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

source

fn set_source_root_with_durability( &mut self, id: SourceRootId, value__: Arc<SourceRoot>, durability__: Durability )

Set the value of the source_root 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 source_root for details.

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

source

fn source_root_crates(&self, id: SourceRootId) -> Arc<[CrateId]>

Crates whose root fool is in id.

Implementors§

source§

impl<DB> SourceDatabaseExt for DB
where DB: SourceDatabase + Database + HasQueryGroup<SourceDatabaseExtStorage>,