pub struct DependencyGraph {
pub root: NodeId,
pub nodes: Vec<Node>,
pub edges: Vec<Edge>,
pub declared_interpreter: Option<PathBuf>,
pub executable_search_paths: Vec<String>,
/* private fields */
}Fields§
§root: NodeId§nodes: Vec<Node>§edges: Vec<Edge>Every edge, in insertion order.
declared_interpreter: Option<PathBuf>PT_INTERP exactly as declared by the executable, before symlinks are
followed. This is the path the kernel will use at runtime.
executable_search_paths: Vec<String>DT_RPATH and DT_RUNPATH of the executable, verbatim and unexpanded.
They travel with the binary, so they matter when it is installed
somewhere other than where it was built.
Implementations§
Source§impl DependencyGraph
impl DependencyGraph
pub fn new() -> DependencyGraph
pub fn node_count(&self) -> usize
Sourcepub fn insert(&mut self, node: Node) -> Result<NodeId>
pub fn insert(&mut self, node: Node) -> Result<NodeId>
Insert a node, deduplicating on the logical source path.
Re-inserting a known object merges its symlink chain: the same library
is often reached through several link paths (/lib64/ld-linux… and
/lib/<tuple>/ld-linux…), and every one of them must be preserved.
pub fn find(&self, logical: &Path) -> Option<NodeId>
pub fn connect( &mut self, from: NodeId, to: NodeId, reason: DependencyReason, ) -> Result<()>
pub fn contains(&self, id: NodeId) -> bool
pub fn node(&self, id: NodeId) -> &Node
pub fn root_node(&self) -> &Node
Sourcepub fn edges_from(&self, id: NodeId) -> impl Iterator<Item = &Edge>
pub fn edges_from(&self, id: NodeId) -> impl Iterator<Item = &Edge>
Edges leaving a node, in insertion order.
Sourcepub fn dependencies(&self, id: NodeId) -> Vec<(&Edge, &Node)>
pub fn dependencies(&self, id: NodeId) -> Vec<(&Edge, &Node)>
Direct dependencies of a node, in insertion order.
Sourcepub fn first_dependent(&self, id: NodeId) -> Option<(&Edge, &Node)>
pub fn first_dependent(&self, id: NodeId) -> Option<(&Edge, &Node)>
First object that pulled in id, used for diagnostics and manifests.
Sourcepub fn iter(&self) -> impl Iterator<Item = (NodeId, &Node)>
pub fn iter(&self) -> impl Iterator<Item = (NodeId, &Node)>
Nodes paired with their ids, in insertion order. The only way to obtain
a NodeId for a node short of looking it up by its logical path.
pub fn total_size(&self) -> u64
Sourcepub fn application_closure(&self) -> HashSet<NodeId>
pub fn application_closure(&self) -> HashSet<NodeId>
Nodes reachable from the executable through its own ELF dependencies.
Objects that only runtime policy asked for (NSS modules and their own dependencies) stay out of this set. They are in the image, but the application never declared them.
Trait Implementations§
Source§impl Clone for DependencyGraph
impl Clone for DependencyGraph
Source§fn clone(&self) -> DependencyGraph
fn clone(&self) -> DependencyGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more