pub struct FileGraph {
pub files: Vec<FileEntry>,
pub edges: Vec<Edge>,
pub unresolved: Vec<UnresolvedInclude>,
pub analysed: Vec<FileId>,
}Expand description
The result of walking one translation unit.
Fields§
§files: Vec<FileEntry>Every file reached, indexed by FileId. A FileId the walk did not reach leaves a placeholder.
edges: Vec<Edge>Every resolved include, in the order the walk reached it.
unresolved: Vec<UnresolvedInclude>Every include that could not be resolved.
analysed: Vec<FileId>The files that were read, in the order they were entered.
Implementations§
Source§impl FileGraph
impl FileGraph
Sourcepub fn entry(&self, file: FileId) -> Option<&FileEntry>
pub fn entry(&self, file: FileId) -> Option<&FileEntry>
Where a file is, if the walk reached it.
None for a file the interner knows but this walk never reached: the interner is shared and may
have minted ids for other walks, so an id is not a promise that there is an entry.
Sourcepub fn includers_of(&self, file: FileId) -> Vec<FileId>
pub fn includers_of(&self, file: FileId) -> Vec<FileId>
The files that include file, directly.
The reverse edge, and the reason the graph exists: an edit to a header invalidates exactly these, and transitively whatever includes them.
Sourcepub fn includes_of(&self, file: FileId) -> Vec<FileId>
pub fn includes_of(&self, file: FileId) -> Vec<FileId>
The files file includes, directly.
Sourcepub fn dependents_of(&self, file: FileId) -> Vec<FileId>
pub fn dependents_of(&self, file: FileId) -> Vec<FileId>
Every file whose analysis an edit to file could change, transitively — file included.
The closure a cache invalidation needs. file itself is included because editing a file invalidates
its own analysis, and the result is sorted so that a caller can compare two runs.
Sourcepub fn analysed_files(&self) -> &[FileId]
pub fn analysed_files(&self) -> &[FileId]
The files this walk read.
Sourcepub fn unresolved_includes(&self) -> &[UnresolvedInclude]
pub fn unresolved_includes(&self) -> &[UnresolvedInclude]
The includes that did not resolve.
Trait Implementations§
Auto Trait Implementations§
impl Forget for FileGraph
impl Freeze for FileGraph
impl RefUnwindSafe for FileGraph
impl Send for FileGraph
impl Sync for FileGraph
impl Unpin for FileGraph
impl UnsafeUnpin for FileGraph
impl UnwindSafe for FileGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more