pub struct ImportGraph {
pub imports: HashMap<String, Vec<String>>,
}Expand description
A simple import graph.
Fields§
§imports: HashMap<String, Vec<String>>Map from module name to list of imported modules
Implementations§
Source§impl ImportGraph
impl ImportGraph
Sourcepub fn add_import(&mut self, from: &str, to: &str)
pub fn add_import(&mut self, from: &str, to: &str)
Add an import edge.
Sourcepub fn imports_of(&self, module: &str) -> &[String]
pub fn imports_of(&self, module: &str) -> &[String]
Returns all imports of a module.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Returns the total number of import edges.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImportGraph
impl RefUnwindSafe for ImportGraph
impl Send for ImportGraph
impl Sync for ImportGraph
impl Unpin for ImportGraph
impl UnsafeUnpin for ImportGraph
impl UnwindSafe for ImportGraph
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