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.
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
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