[][src]Trait ra_ap_base_db::FileLoader

pub trait FileLoader {
    fn file_text(&self, file_id: FileId) -> Arc<String>;
fn resolve_path(&self, anchor: FileId, path: &str) -> Option<FileId>;
fn relevant_crates(&self, file_id: FileId) -> Arc<FxHashSet<CrateId>>; }

Required methods

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

Text of the file.

fn resolve_path(&self, anchor: FileId, path: &str) -> Option<FileId>

Note that we intentionally accept a &str and not a &Path here. This method exists to handle #[path = "/some/path.rs"] mod foo; and such, so the input is guaranteed to be utf-8 string. One might be tempted to introduce some kind of "utf-8 path with / separators", but that's a bad idea. Behold #[path = "C://no/way"]

fn relevant_crates(&self, file_id: FileId) -> Arc<FxHashSet<CrateId>>

Loading content...

Implementors

impl<T: SourceDatabaseExt, '_> FileLoader for FileLoaderDelegate<&'_ T>[src]

Loading content...