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.