pub struct StructuralIndex { /* private fields */ }Expand description
Structural index: maps entities to WL fingerprints and partitions entities by fingerprint for fast structural queries.
Implementations§
Source§impl StructuralIndex
impl StructuralIndex
pub fn new() -> Self
pub fn with_depth(depth: usize) -> Self
Sourcepub fn compute(
&mut self,
entities: &HashMap<String, HDict>,
id_map: &HashMap<String, usize>,
adjacency_targets: impl Fn(&str) -> Vec<String>,
)
pub fn compute( &mut self, entities: &HashMap<String, HDict>, id_map: &HashMap<String, usize>, adjacency_targets: impl Fn(&str) -> Vec<String>, )
Full recomputation of the structural index.
Sourcepub fn fingerprint(&self, ref_val: &str) -> Option<u64>
pub fn fingerprint(&self, ref_val: &str) -> Option<u64>
Get the fingerprint for an entity.
Sourcepub fn partition(&self, fingerprint: u64) -> Option<&RoaringBitmap>
pub fn partition(&self, fingerprint: u64) -> Option<&RoaringBitmap>
Get the entity IDs in a structural partition.
Find all partitions whose entities have ALL the given required tags.
Sourcepub fn partition_count(&self) -> usize
pub fn partition_count(&self) -> usize
Number of distinct structural partitions.
Sourcepub fn mark_stale(&mut self)
pub fn mark_stale(&mut self)
Mark the index as needing recomputation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StructuralIndex
impl RefUnwindSafe for StructuralIndex
impl Send for StructuralIndex
impl Sync for StructuralIndex
impl Unpin for StructuralIndex
impl UnsafeUnpin for StructuralIndex
impl UnwindSafe for StructuralIndex
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