pub struct Index { /* private fields */ }Expand description
Provides asynchronous access to an index in a database.
Implementations§
Source§impl Index
impl Index
Sourcepub fn object_store(&self) -> ObjectStore
pub fn object_store(&self) -> ObjectStore
Returns the ObjectStore the index belongs to.
Sourcepub fn multi_entry(&self) -> bool
pub fn multi_entry(&self) -> bool
Returns true if the index’s multi_entry flag is true.
Sourcepub fn get(&self, query: impl Into<Query>) -> Result<StoreRequest, Error>
pub fn get(&self, query: impl Into<Query>) -> Result<StoreRequest, Error>
Retrieves the value of the first record matching the given key or key range in query.
Sourcepub fn get_key(&self, query: impl Into<Query>) -> Result<StoreRequest, Error>
pub fn get_key(&self, query: impl Into<Query>) -> Result<StoreRequest, Error>
Retrieves the key of the first record matching the given key or key range in query.
Sourcepub fn get_all(
&self,
query: Option<Query>,
limit: Option<u32>,
) -> Result<StoreRequest, Error>
pub fn get_all( &self, query: Option<Query>, limit: Option<u32>, ) -> Result<StoreRequest, Error>
Retrieves the values of the records matching the given key or key range in query (up to limit if given).
Sourcepub fn get_all_keys(
&self,
query: Option<Query>,
limit: Option<u32>,
) -> Result<StoreRequest, Error>
pub fn get_all_keys( &self, query: Option<Query>, limit: Option<u32>, ) -> Result<StoreRequest, Error>
Retrieves the keys of records matching the given key or key range in query (up to limit if given).
Sourcepub fn count(&self, query: Option<Query>) -> Result<StoreRequest, Error>
pub fn count(&self, query: Option<Query>) -> Result<StoreRequest, Error>
Retrieves the number of records matching the given key or key range in query.
Sourcepub fn open_cursor(
&self,
query: Option<Query>,
cursor_direction: Option<CursorDirection>,
) -> Result<StoreRequest, Error>
pub fn open_cursor( &self, query: Option<Query>, cursor_direction: Option<CursorDirection>, ) -> Result<StoreRequest, Error>
Opens a Cursor over the records matching query, ordered by direction. If query is None, all
records in index are matched.
Sourcepub fn open_key_cursor(
&self,
query: Option<Query>,
cursor_direction: Option<CursorDirection>,
) -> Result<StoreRequest, Error>
pub fn open_key_cursor( &self, query: Option<Query>, cursor_direction: Option<CursorDirection>, ) -> Result<StoreRequest, Error>
Opens a KeyCursor over the records matching query, ordered by direction. If query is
None, all records in index are matched.