pub struct LinkTable {
pub fingerprints: Vec<BlockFingerprint>,
pub links: Vec<StructuralLink>,
}Expand description
Link table — mmap-friendly storage of structural links.
Fields§
§fingerprints: Vec<BlockFingerprint>§links: Vec<StructuralLink>Implementations§
Source§impl LinkTable
impl LinkTable
Sourcepub fn links_for(&self, block_idx: u32) -> Vec<&StructuralLink>
pub fn links_for(&self, block_idx: u32) -> Vec<&StructuralLink>
Get structural links for a specific block.
Sourcepub fn linked_blocks(&self, block_idx: u32) -> Vec<(u32, f32)>
pub fn linked_blocks(&self, block_idx: u32) -> Vec<(u32, f32)>
Get the other end of a link from a given block.
Sourcepub fn find_similar(&self, text: &str, k: usize) -> Vec<(u32, f32)>
pub fn find_similar(&self, text: &str, k: usize) -> Vec<(u32, f32)>
Find the most structurally similar blocks to a query text.
Sourcepub fn stats(&self) -> FingerprintStats
pub fn stats(&self) -> FingerprintStats
Statistics.
Sourcepub fn load_cached(output_dir: &Path) -> Option<Arc<LinkTable>>
pub fn load_cached(output_dir: &Path) -> Option<Arc<LinkTable>>
Load the link table, reusing a previous instance when neither
fingerprints.idx nor links.bin has changed on disk.
The MCP server rebuilt this on every recall: 65.8 MB of links parsed per query. A long-lived process may hold it; the (length, mtime) stamp of both files reloads it after a rebuild rewrites either one, so a server that outlives a rebuild does not serve a stale table.
Auto Trait Implementations§
impl Freeze for LinkTable
impl RefUnwindSafe for LinkTable
impl Send for LinkTable
impl Sync for LinkTable
impl Unpin for LinkTable
impl UnsafeUnpin for LinkTable
impl UnwindSafe for LinkTable
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more