pub struct LinkGraph { /* private fields */ }Expand description
Link graph for analyzing vault relationships
Implementations§
Source§impl LinkGraph
impl LinkGraph
Sourcepub fn remove_file(&mut self, path: &PathBuf) -> Result<()>
pub fn remove_file(&mut self, path: &PathBuf) -> Result<()>
Remove a file from the graph
Sourcepub fn update_links(&mut self, file: &VaultFile) -> Result<()>
pub fn update_links(&mut self, file: &VaultFile) -> Result<()>
Add links from a parsed file to the graph
Sourcepub fn backlinks(&self, path: &PathBuf) -> Result<Vec<(PathBuf, Vec<Link>)>>
pub fn backlinks(&self, path: &PathBuf) -> Result<Vec<(PathBuf, Vec<Link>)>>
Get all backlinks to a file (files that link to this file)
Sourcepub fn forward_links(&self, path: &PathBuf) -> Result<Vec<(PathBuf, Vec<Link>)>>
pub fn forward_links(&self, path: &PathBuf) -> Result<Vec<(PathBuf, Vec<Link>)>>
Get all forward links from a file (files this file links to)
Sourcepub fn orphaned_notes(&self) -> Vec<PathBuf>
pub fn orphaned_notes(&self) -> Vec<PathBuf>
Find all orphaned notes (no incoming or outgoing links)
Find related notes within N hops (breadth-first search)
Sourcepub fn cycles(&self) -> Vec<Vec<PathBuf>>
pub fn cycles(&self) -> Vec<Vec<PathBuf>>
Find strongly connected components (cycles in the graph)
Sourcepub fn stats(&self) -> GraphStats
pub fn stats(&self) -> GraphStats
Get statistics about the graph
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get node count
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get edge count
Sourcepub fn incoming_links(&self, path: &PathBuf) -> Result<Vec<Link>>
pub fn incoming_links(&self, path: &PathBuf) -> Result<Vec<Link>>
Get incoming links to a file (just the Link objects)
Sourcepub fn outgoing_links(&self, path: &PathBuf) -> Result<Vec<Link>>
pub fn outgoing_links(&self, path: &PathBuf) -> Result<Vec<Link>>
Get outgoing links from a file (just the Link objects)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LinkGraph
impl RefUnwindSafe for LinkGraph
impl Send for LinkGraph
impl Sync for LinkGraph
impl Unpin for LinkGraph
impl UnwindSafe for LinkGraph
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