pub struct ProgramGraph { /* private fields */ }Implementations§
Source§impl ProgramGraph
impl ProgramGraph
pub fn from_files( files: impl IntoIterator<Item = FileAnalysis>, ) -> Result<Self, String>
pub fn functions(&self) -> &BTreeMap<SymbolId, FunctionInfo>
pub fn facts(&self) -> &[LanguageFact]
pub fn resolution_diagnostics(&self) -> Vec<String>
pub fn source_files(&self) -> BTreeSet<PathBuf>
pub fn analyzes_file(&self, file: &Path) -> bool
pub fn has_functions_in_file(&self, file: &Path) -> bool
pub fn public_symbols(&self) -> BTreeSet<SymbolId>
Sourcepub fn inferred_roots(&self) -> BTreeSet<SymbolId>
pub fn inferred_roots(&self) -> BTreeSet<SymbolId>
Return one deterministic root for every source component in the graph. Functions with no incoming call are natural roots. A closed recursive component has no such function, so its earliest source definition is used as that component’s presentation root.
pub fn roots_in_file(&self, file: &Path) -> BTreeSet<SymbolId>
pub fn resolve_entry(&self, entry: &str) -> Result<Option<SymbolId>, String>
Sourcepub fn resolve_entries(&self, entry: &str) -> Result<Vec<SymbolId>, String>
pub fn resolve_entries(&self, entry: &str) -> Result<Vec<SymbolId>, String>
Resolve an entry to all compiler-proven call contexts of the same source function. Ordinary name ambiguity remains an error.
Sourcepub fn resolve_entries_in_file(
&self,
entry: &str,
file: &Path,
) -> Result<Vec<SymbolId>, String>
pub fn resolve_entries_in_file( &self, entry: &str, file: &Path, ) -> Result<Vec<SymbolId>, String>
Resolve only definitions whose bodies belong to file. This keeps an
explicit entry in file mode from silently selecting an equally named
function in another project file.
pub fn build_call_tree( &self, entry: &SymbolId, max_depth: usize, ) -> Option<CallNode>
pub fn build_call_tree_in_file( &self, entry: &SymbolId, max_depth: usize, file: Option<&Path>, ) -> Option<CallNode>
Trait Implementations§
Source§impl Clone for ProgramGraph
impl Clone for ProgramGraph
Source§impl Debug for ProgramGraph
impl Debug for ProgramGraph
Auto Trait Implementations§
impl DynSend for ProgramGraph
impl DynSync for ProgramGraph
impl Freeze for ProgramGraph
impl RefUnwindSafe for ProgramGraph
impl Send for ProgramGraph
impl Sync for ProgramGraph
impl Unpin for ProgramGraph
impl UnsafeUnpin for ProgramGraph
impl UnwindSafe for ProgramGraph
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
Mutably borrows from an owned value. Read more