pub struct MetadataIndexManager { /* private fields */ }Expand description
Manager for all metadata indexes
Implementations§
Source§impl MetadataIndexManager
impl MetadataIndexManager
Sourcepub fn create_index(&mut self, name: &str, config: IndexConfig) -> Result<()>
pub fn create_index(&mut self, name: &str, config: IndexConfig) -> Result<()>
Create an index on a field
Sourcepub fn drop_index(&mut self, name: &str) -> Result<()>
pub fn drop_index(&mut self, name: &str) -> Result<()>
Drop an index
Sourcepub fn insert(
&mut self,
metadata: &Map<String, Value>,
id: String,
) -> Result<()>
pub fn insert( &mut self, metadata: &Map<String, Value>, id: String, ) -> Result<()>
Insert metadata into all relevant indexes
Sourcepub fn remove(&mut self, metadata: &Map<String, Value>, id: &str) -> Result<()>
pub fn remove(&mut self, metadata: &Map<String, Value>, id: &str) -> Result<()>
Remove metadata from all relevant indexes
Sourcepub fn query(
&self,
field: &str,
op: &str,
value: &Value,
) -> Option<HashSet<String>>
pub fn query( &self, field: &str, op: &str, value: &Value, ) -> Option<HashSet<String>>
Query using indexes
Sourcepub fn query_in(&self, field: &str, values: &[Value]) -> Option<HashSet<String>>
pub fn query_in(&self, field: &str, values: &[Value]) -> Option<HashSet<String>>
Query IN operator using hash index
Sourcepub fn list_indexes(&self) -> Vec<String>
pub fn list_indexes(&self) -> Vec<String>
List all indexes
Sourcepub fn index_stats(&self, name: &str) -> Option<IndexStats>
pub fn index_stats(&self, name: &str) -> Option<IndexStats>
Get statistics for an index
Trait Implementations§
Source§impl Clone for MetadataIndexManager
impl Clone for MetadataIndexManager
Source§fn clone(&self) -> MetadataIndexManager
fn clone(&self) -> MetadataIndexManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetadataIndexManager
impl Debug for MetadataIndexManager
Source§impl Default for MetadataIndexManager
impl Default for MetadataIndexManager
Source§fn default() -> MetadataIndexManager
fn default() -> MetadataIndexManager
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MetadataIndexManager
impl<'de> Deserialize<'de> for MetadataIndexManager
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MetadataIndexManager
impl RefUnwindSafe for MetadataIndexManager
impl Send for MetadataIndexManager
impl Sync for MetadataIndexManager
impl Unpin for MetadataIndexManager
impl UnwindSafe for MetadataIndexManager
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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