pub struct FilesDatabaseForTesting { /* private fields */ }
Trait Implementations§
source§impl AsFilesGroupMut for FilesDatabaseForTesting
impl AsFilesGroupMut for FilesDatabaseForTesting
fn as_files_group_mut(&mut self) -> &mut (dyn FilesGroup + 'static)
source§impl Database for FilesDatabaseForTesting
impl Database for FilesDatabaseForTesting
source§fn sweep_all(&self, strategy: SweepStrategy)
fn sweep_all(&self, strategy: SweepStrategy)
Iterates through all query storage and removes any values that
have not been used since the last revision was created. The
intended use-cycle is that you first execute all of your
“main” queries; this will ensure that all query values they
consume are marked as used. You then invoke this method to
remove other values that were not needed for your main query
results.
source§fn salsa_event(&self, event_fn: Event)
fn salsa_event(&self, event_fn: Event)
This function is invoked at key points in the salsa
runtime. It permits the database to be customized and to
inject logging or other custom behavior.
source§fn on_propagated_panic(&self) -> !
fn on_propagated_panic(&self) -> !
This function is invoked when a dependent query is being computed by the
other thread, and that thread panics.
source§fn salsa_runtime(&self) -> &Runtime
fn salsa_runtime(&self) -> &Runtime
Gives access to the underlying salsa runtime.
source§fn salsa_runtime_mut(&mut self) -> &mut Runtime
fn salsa_runtime_mut(&mut self) -> &mut Runtime
Gives access to the underlying salsa runtime.
source§impl DatabaseOps for FilesDatabaseForTesting
impl DatabaseOps for FilesDatabaseForTesting
source§fn ops_database(&self) -> &dyn Database
fn ops_database(&self) -> &dyn Database
Upcast this type to a
dyn Database
.source§fn ops_salsa_runtime(&self) -> &Runtime
fn ops_salsa_runtime(&self) -> &Runtime
Gives access to the underlying salsa runtime.
source§fn ops_salsa_runtime_mut(&mut self) -> &mut Runtime
fn ops_salsa_runtime_mut(&mut self) -> &mut Runtime
Gives access to the underlying salsa runtime.
source§fn fmt_index(&self, input: DatabaseKeyIndex, fmt: &mut Formatter<'_>) -> Result
fn fmt_index(&self, input: DatabaseKeyIndex, fmt: &mut Formatter<'_>) -> Result
Formats a database key index in a human readable fashion.
source§fn maybe_changed_since(
&self,
input: DatabaseKeyIndex,
revision: Revision
) -> bool
fn maybe_changed_since( &self, input: DatabaseKeyIndex, revision: Revision ) -> bool
True if the computed value for
input
may have changed since revision
.source§fn for_each_query(&self, op: &mut dyn FnMut(&dyn QueryStorageMassOps))
fn for_each_query(&self, op: &mut dyn FnMut(&dyn QueryStorageMassOps))
Executes the callback for each kind of query.
source§impl DatabaseStorageTypes for FilesDatabaseForTesting
impl DatabaseStorageTypes for FilesDatabaseForTesting
§type DatabaseStorage = __SalsaDatabaseStorage
type DatabaseStorage = __SalsaDatabaseStorage
Defines the “storage type”, where all the query data is kept.
This type is defined by the
database_storage
macro.source§impl Default for FilesDatabaseForTesting
impl Default for FilesDatabaseForTesting
source§impl HasQueryGroup<FilesDatabase> for FilesDatabaseForTesting
impl HasQueryGroup<FilesDatabase> for FilesDatabaseForTesting
source§fn group_storage(&self) -> &<FilesDatabase as QueryGroup>::GroupStorage
fn group_storage(&self) -> &<FilesDatabase as QueryGroup>::GroupStorage
Access the group storage struct from the database.
source§impl Upcast<dyn FilesGroup + 'static> for FilesDatabaseForTesting
impl Upcast<dyn FilesGroup + 'static> for FilesDatabaseForTesting
fn upcast(&self) -> &(dyn FilesGroup + 'static)
Auto Trait Implementations§
impl RefUnwindSafe for FilesDatabaseForTesting
impl Send for FilesDatabaseForTesting
impl !Sync for FilesDatabaseForTesting
impl Unpin for FilesDatabaseForTesting
impl UnwindSafe for FilesDatabaseForTesting
Blanket Implementations§
source§impl<DB> FilesGroup for DBwhere
DB: Database + HasQueryGroup<FilesDatabase>,
impl<DB> FilesGroup for DBwhere DB: Database + HasQueryGroup<FilesDatabase>,
fn intern_crate(&self, key0: CrateLongId) -> CrateId
fn lookup_intern_crate(&self, key0: CrateId) -> CrateLongId
fn intern_file(&self, key0: FileLongId) -> FileId
fn lookup_intern_file(&self, key0: FileId) -> FileLongId
source§fn crate_roots(&self) -> Arc<HashMap<CrateId, Directory, RandomState>>
fn crate_roots(&self) -> Arc<HashMap<CrateId, Directory, RandomState>>
Main input of the project. Lists all the crates.
source§fn set_crate_roots(
&mut self,
value__: Arc<HashMap<CrateId, Directory, RandomState>>
)
fn set_crate_roots( &mut self, value__: Arc<HashMap<CrateId, Directory, RandomState>> )
Set the value of the
crate_roots
input. Read moresource§fn set_crate_roots_with_durability(
&mut self,
value__: Arc<HashMap<CrateId, Directory, RandomState>>,
durability__: Durability
)
fn set_crate_roots_with_durability( &mut self, value__: Arc<HashMap<CrateId, Directory, RandomState>>, durability__: Durability )
Set the value of the
crate_roots
input and promise
that its value will never change again. Read moresource§fn file_overrides(&self) -> Arc<HashMap<FileId, Arc<String>, RandomState>>
fn file_overrides(&self) -> Arc<HashMap<FileId, Arc<String>, RandomState>>
Overrides for file content. Mostly used by language server and tests.
TODO(spapini): Currently, when this input changes, all the file_content() queries will
be invalidated.
Change this mechanism to hold file_overrides on the db struct outside salsa mechanism,
and invalidate manually.
source§fn set_file_overrides(
&mut self,
value__: Arc<HashMap<FileId, Arc<String>, RandomState>>
)
fn set_file_overrides( &mut self, value__: Arc<HashMap<FileId, Arc<String>, RandomState>> )
Set the value of the
file_overrides
input. Read moresource§fn set_file_overrides_with_durability(
&mut self,
value__: Arc<HashMap<FileId, Arc<String>, RandomState>>,
durability__: Durability
)
fn set_file_overrides_with_durability( &mut self, value__: Arc<HashMap<FileId, Arc<String>, RandomState>>, durability__: Durability )
Set the value of the
file_overrides
input and promise
that its value will never change again. Read moresource§fn priv_raw_file_content(&self, key0: FileId) -> Option<Arc<String>>
fn priv_raw_file_content(&self, key0: FileId) -> Option<Arc<String>>
Query for raw file contents. Private.
source§fn file_content(&self, key0: FileId) -> Option<Arc<String>>
fn file_content(&self, key0: FileId) -> Option<Arc<String>>
Query for the file contents. This takes overrides into consideration.