Struct ethers_solc::resolver::GraphEdges
source · pub struct GraphEdges { /* private fields */ }
Expand description
The underlying edges of the graph which only contains the raw relationship data.
This is kept separate from the Graph
as the Node
s get consumed when the Solc
to Sources
set is determined.
Implementations§
source§impl GraphEdges
impl GraphEdges
sourcepub fn num_source_files(&self) -> usize
pub fn num_source_files(&self) -> usize
How many files are source files
sourcepub fn files(&self) -> impl Iterator<Item = usize> + '_
pub fn files(&self) -> impl Iterator<Item = usize> + '_
Returns an iterator over all file indices
sourcepub fn source_files(&self) -> impl Iterator<Item = usize> + '_
pub fn source_files(&self) -> impl Iterator<Item = usize> + '_
Returns an iterator over all source file indices
sourcepub fn library_files(&self) -> impl Iterator<Item = usize> + '_
pub fn library_files(&self) -> impl Iterator<Item = usize> + '_
Returns an iterator over all library files
sourcepub fn include_paths(&self) -> &IncludePaths
pub fn include_paths(&self) -> &IncludePaths
Returns all additional --include-paths
sourcepub fn unresolved_imports(&self) -> &HashSet<(PathBuf, PathBuf)>
pub fn unresolved_imports(&self) -> &HashSet<(PathBuf, PathBuf)>
Returns all imports that we failed to resolve
sourcepub fn imported_nodes(&self, from: usize) -> &[usize]
pub fn imported_nodes(&self, from: usize) -> &[usize]
Returns a list of nodes the given node index points to for the given kind.
sourcepub fn all_imported_nodes(
&self,
from: usize
) -> impl Iterator<Item = usize> + '_
pub fn all_imported_nodes( &self, from: usize ) -> impl Iterator<Item = usize> + '_
Returns an iterator that yields all imports of a node and all their imports
sourcepub fn imports(&self, file: impl AsRef<Path>) -> HashSet<&PathBuf>
pub fn imports(&self, file: impl AsRef<Path>) -> HashSet<&PathBuf>
Returns all files imported by the given file
sourcepub fn is_input_file(&self, file: impl AsRef<Path>) -> bool
pub fn is_input_file(&self, file: impl AsRef<Path>) -> bool
Returns true if the file
was originally included when the graph was first created and not
added when all imports
were resolved
sourcepub fn version_requirement(&self, file: impl AsRef<Path>) -> Option<&VersionReq>
pub fn version_requirement(&self, file: impl AsRef<Path>) -> Option<&VersionReq>
Returns the VersionReq
for the given file
sourcepub fn get_link_references(&self, file: impl AsRef<Path>) -> HashSet<&PathBuf>
pub fn get_link_references(&self, file: impl AsRef<Path>) -> HashSet<&PathBuf>
Returns those library files that will be required as linkReferences
by the given file
This is a preprocess function that attempts to resolve those libraries that will the
solidity file
will be required to link. And further restrict this list to libraries
that won’t be inlined.
See also parse::SolLibrary
.