Skip to main content

LoadedFileIndexes

Trait LoadedFileIndexes 

Source
pub trait LoadedFileIndexes {
    // Required methods
    fn contains_file(&self, rel_path: &str) -> bool;
    fn file_index(&self, rel_path: &str) -> Option<LoadedIndex>;
    fn rust_files(&self) -> Vec<String>;
    fn module_declaring_files(&self) -> Vec<String>;

    // Provided method
    fn module_parents(&self) -> Option<Arc<ModuleParents>> { ... }
}
Expand description

File indexes a ProjectIndex loads when resolution first reaches them, rather than binding every file eagerly.

Required Methods§

Source

fn contains_file(&self, rel_path: &str) -> bool

Whether rel_path is an indexed file.

Source

fn file_index(&self, rel_path: &str) -> Option<LoadedIndex>

rel_path’s index, or None when it is not an indexed file.

Source

fn rust_files(&self) -> Vec<String>

Every indexed Rust file, in no order.

Source

fn module_declaring_files(&self) -> Vec<String>

Every indexed file that declares a module, in no order.

Provided Methods§

Source

fn module_parents(&self) -> Option<Arc<ModuleParents>>

For each declared module target, its parent: the smallest (declaring file, module name) pair over every module-declaring file, as note_module_parents keeps it. None when the loader does not keep them, and the index binds every module-declaring file to find them.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§