Trait mun_hir::SourceDatabase
source · pub trait SourceDatabase: Database + HasQueryGroup<SourceDatabaseStorage> + Database {
Show 15 methods
fn file_text(&self, key0: FileId) -> Arc<str>;
fn set_file_text(&mut self, key0: FileId, value__: Arc<str>);
fn set_file_text_with_durability(
&mut self,
key0: FileId,
value__: Arc<str>,
durability__: Durability
);
fn file_source_root(&self, key0: FileId) -> SourceRootId;
fn set_file_source_root(&mut self, key0: FileId, value__: SourceRootId);
fn set_file_source_root_with_durability(
&mut self,
key0: FileId,
value__: SourceRootId,
durability__: Durability
);
fn file_relative_path(&self, key0: FileId) -> RelativePathBuf;
fn source_root(&self, key0: SourceRootId) -> Arc<SourceRoot>;
fn set_source_root(&mut self, key0: SourceRootId, value__: Arc<SourceRoot>);
fn set_source_root_with_durability(
&mut self,
key0: SourceRootId,
value__: Arc<SourceRoot>,
durability__: Durability
);
fn module_tree(&self, key0: PackageId) -> Arc<ModuleTree>;
fn line_index(&self, key0: FileId) -> Arc<LineIndex>;
fn packages(&self) -> Arc<PackageSet>;
fn set_packages(&mut self, value__: Arc<PackageSet>);
fn set_packages_with_durability(
&mut self,
value__: Arc<PackageSet>,
durability__: Durability
);
}
Expand description
Database which stores all significant input facts: source code and project model.
Required Methods§
sourcefn set_file_text(&mut self, key0: FileId, value__: Arc<str>)
fn set_file_text(&mut self, key0: FileId, value__: Arc<str>)
Set the value of the file_text
input.
See 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_file_text_with_durability(
&mut self,
key0: FileId,
value__: Arc<str>,
durability__: Durability
)
fn set_file_text_with_durability(
&mut self,
key0: FileId,
value__: Arc<str>,
durability__: Durability
)
Set the value of the file_text
input and promise
that its value will never change again.
See file_text
for details.
Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.
sourcefn file_source_root(&self, key0: FileId) -> SourceRootId
fn file_source_root(&self, key0: FileId) -> SourceRootId
Source root of a file
sourcefn set_file_source_root(&mut self, key0: FileId, value__: SourceRootId)
fn set_file_source_root(&mut self, key0: 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.
sourcefn set_file_source_root_with_durability(
&mut self,
key0: FileId,
value__: SourceRootId,
durability__: Durability
)
fn set_file_source_root_with_durability(
&mut self,
key0: FileId,
value__: SourceRootId,
durability__: Durability
)
Set the value of the file_source_root
input and 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.
sourcefn file_relative_path(&self, key0: FileId) -> RelativePathBuf
fn file_relative_path(&self, key0: FileId) -> RelativePathBuf
Returns the relative path of a file
sourcefn source_root(&self, key0: SourceRootId) -> Arc<SourceRoot>
fn source_root(&self, key0: SourceRootId) -> Arc<SourceRoot>
Contents of the source root
sourcefn set_source_root(&mut self, key0: SourceRootId, value__: Arc<SourceRoot>)
fn set_source_root(&mut self, key0: 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.
sourcefn set_source_root_with_durability(
&mut self,
key0: SourceRootId,
value__: Arc<SourceRoot>,
durability__: Durability
)
fn set_source_root_with_durability(
&mut self,
key0: SourceRootId,
value__: Arc<SourceRoot>,
durability__: Durability
)
Set the value of the source_root
input and 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.
sourcefn module_tree(&self, key0: PackageId) -> Arc<ModuleTree>
fn module_tree(&self, key0: PackageId) -> Arc<ModuleTree>
For a package, returns its hierarchy of modules.
sourcefn line_index(&self, key0: FileId) -> Arc<LineIndex>
fn line_index(&self, key0: FileId) -> Arc<LineIndex>
Returns the line index of a file
sourcefn packages(&self) -> Arc<PackageSet>
fn packages(&self) -> Arc<PackageSet>
Returns the set of packages
sourcefn set_packages(&mut self, value__: Arc<PackageSet>)
fn set_packages(&mut self, value__: Arc<PackageSet>)
Set the value of the packages
input.
See packages
for details.
Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.
sourcefn set_packages_with_durability(
&mut self,
value__: Arc<PackageSet>,
durability__: Durability
)
fn set_packages_with_durability(
&mut self,
value__: Arc<PackageSet>,
durability__: Durability
)
Set the value of the packages
input and promise
that its value will never change again.
See packages
for details.
Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.