pub struct KeySearchIndex { /* private fields */ }Expand description
Key search index
Implementations§
Source§impl KeySearchIndex
impl KeySearchIndex
pub fn new() -> Self
pub fn initialize(&mut self) -> Result<(), CryptographicError>
Sourcepub fn index(&mut self, entry: KeyIndexEntry)
pub fn index(&mut self, entry: KeyIndexEntry)
Add an entry to the search index, keyed by its entry_id.
Sourcepub fn index_key(&mut self, key_id: &str, metadata: &KeyMetadata)
pub fn index_key(&mut self, key_id: &str, metadata: &KeyMetadata)
Index a key together with its metadata so it becomes discoverable via
Self::search with a structured SearchQuery.
Sourcepub fn set_purpose(&mut self, key_id: &str, purpose: KeyPurpose)
pub fn set_purpose(&mut self, key_id: &str, purpose: KeyPurpose)
Assign a purpose to an indexed key.
Sourcepub fn search_by_keyword(&self, query: &str) -> Vec<&KeyIndexEntry>
pub fn search_by_keyword(&self, query: &str) -> Vec<&KeyIndexEntry>
Keyword search across index entries (case-insensitive substring match).
Returns references to every entry whose entry_id or any keyword contains
the query substring.
Sourcepub fn search(&self, query: &SearchQuery) -> Vec<SearchResult>
pub fn search(&self, query: &SearchQuery) -> Vec<SearchResult>
Structured search over the indexed keys. Delegates to the underlying
KeySearchEngine.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Number of indexed entries.
Sourcepub fn indexed_key_count(&self) -> usize
pub fn indexed_key_count(&self) -> usize
Number of keys indexed via Self::index_key.
Auto Trait Implementations§
impl Freeze for KeySearchIndex
impl RefUnwindSafe for KeySearchIndex
impl Send for KeySearchIndex
impl Sync for KeySearchIndex
impl Unpin for KeySearchIndex
impl UnsafeUnpin for KeySearchIndex
impl UnwindSafe for KeySearchIndex
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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