pub struct EntityIndex { /* private fields */ }Expand description
Inverted index for entity mentions.
Implementations§
Source§impl EntityIndex
impl EntityIndex
pub fn new() -> Self
Sourcepub fn add_mention(
&mut self,
entity: &str,
sequence: u64,
entity_type: EntityType,
)
pub fn add_mention( &mut self, entity: &str, sequence: u64, entity_type: EntityType, )
Add entity mention
Sourcepub fn query_entity(&self, entity: &str) -> Vec<IndexResult>
pub fn query_entity(&self, entity: &str) -> Vec<IndexResult>
Query blocks mentioning an entity
Sourcepub fn query_prefix(&self, prefix: &str) -> Vec<IndexResult>
pub fn query_prefix(&self, prefix: &str) -> Vec<IndexResult>
Query blocks mentioning entities matching a prefix
Sourcepub fn get_entities_by_type(&self, entity_type: EntityType) -> Vec<String>
pub fn get_entities_by_type(&self, entity_type: EntityType) -> Vec<String>
Get all entities of a type
Sourcepub fn get_all_files(&self) -> Vec<String>
pub fn get_all_files(&self) -> Vec<String>
Get all files mentioned
Trait Implementations§
Source§impl Default for EntityIndex
impl Default for EntityIndex
Auto Trait Implementations§
impl Freeze for EntityIndex
impl RefUnwindSafe for EntityIndex
impl Send for EntityIndex
impl Sync for EntityIndex
impl Unpin for EntityIndex
impl UnsafeUnpin for EntityIndex
impl UnwindSafe for EntityIndex
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