pub struct BacklinkIndex { /* private fields */ }Expand description
Bidirectional link index.
Maintains forward links (source → targets) and backward links (target → sources) for O(1) lookup.
Implementations§
Source§impl BacklinkIndex
impl BacklinkIndex
Sourcepub fn index_file(&mut self, path: &str, content: &str)
pub fn index_file(&mut self, path: &str, content: &str)
Index all links in a file’s content.
Replaces any previously indexed links for this file (incremental update).
Sourcepub fn remove_file(&mut self, path: &str)
pub fn remove_file(&mut self, path: &str)
Remove a file from the index.
Sourcepub fn backlinks_for(&self, path: &str) -> Vec<Backlink>
pub fn backlinks_for(&self, path: &str) -> Vec<Backlink>
Get all backlinks pointing to a file (files that reference this one).
Sourcepub fn forward_links_for(&self, path: &str) -> Vec<String>
pub fn forward_links_for(&self, path: &str) -> Vec<String>
Get all forward links from a file (files this one references).
Sourcepub fn backlink_count(&self, path: &str) -> usize
pub fn backlink_count(&self, path: &str) -> usize
Get the number of backlinks for a file.
Sourcepub fn link_graph(&self) -> LinkGraph
pub fn link_graph(&self) -> LinkGraph
Get the full link graph for visualization.
Sourcepub fn connection_strength(&self, path_a: &str, path_b: &str) -> usize
pub fn connection_strength(&self, path_a: &str, path_b: &str) -> usize
Compute connection strength between two files (shared backlink sources).
Trait Implementations§
Source§impl Clone for BacklinkIndex
impl Clone for BacklinkIndex
Source§fn clone(&self) -> BacklinkIndex
fn clone(&self) -> BacklinkIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BacklinkIndex
impl Debug for BacklinkIndex
Source§impl Default for BacklinkIndex
impl Default for BacklinkIndex
Source§fn default() -> BacklinkIndex
fn default() -> BacklinkIndex
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BacklinkIndex
impl RefUnwindSafe for BacklinkIndex
impl Send for BacklinkIndex
impl Sync for BacklinkIndex
impl Unpin for BacklinkIndex
impl UnsafeUnpin for BacklinkIndex
impl UnwindSafe for BacklinkIndex
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