pub trait SourceDatabase: Database {
// Required methods
fn file_text(&self, file_id: FileId) -> FileText;
fn set_file_text(&mut self, file_id: FileId, text: &str);
fn set_file_text_with_durability(
&mut self,
file_id: FileId,
text: &str,
durability: Durability,
);
fn source_root(&self, id: SourceRootId) -> SourceRootInput;
fn file_source_root(&self, id: FileId) -> FileSourceRootInput;
fn set_file_source_root_with_durability(
&mut self,
id: FileId,
source_root_id: SourceRootId,
durability: Durability,
);
fn set_source_root_with_durability(
&mut self,
source_root_id: SourceRootId,
source_root: Arc<SourceRoot>,
durability: Durability,
);
// Provided method
fn resolve_path(&self, path: AnchoredPath<'_>) -> Option<FileId> { ... }
}
Required Methods§
fn set_file_text(&mut self, file_id: FileId, text: &str)
fn set_file_text_with_durability( &mut self, file_id: FileId, text: &str, durability: Durability, )
Sourcefn source_root(&self, id: SourceRootId) -> SourceRootInput
fn source_root(&self, id: SourceRootId) -> SourceRootInput
Contents of the source root.
fn file_source_root(&self, id: FileId) -> FileSourceRootInput
fn set_file_source_root_with_durability( &mut self, id: FileId, source_root_id: SourceRootId, durability: Durability, )
Sourcefn set_source_root_with_durability(
&mut self,
source_root_id: SourceRootId,
source_root: Arc<SourceRoot>,
durability: Durability,
)
fn set_source_root_with_durability( &mut self, source_root_id: SourceRootId, source_root: Arc<SourceRoot>, durability: Durability, )
Source root of the file.