pub struct Index { /* private fields */ }
Expand description
Provides asynchronous access to an index in a database.
Implementations§
Source§impl Index
impl Index
Sourcepub fn builder(name: String, key_path: KeyPath) -> IndexBuilder
Available on crate feature builder
only.
pub fn builder(name: String, key_path: KeyPath) -> IndexBuilder
builder
only.Creates a new instance of IndexBuilder
.
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<GetStoreRequest, Error>
pub fn get(&self, query: impl Into<Query>) -> Result<GetStoreRequest, 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<GetKeyStoreRequest, Error>
pub fn get_key( &self, query: impl Into<Query>, ) -> Result<GetKeyStoreRequest, 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<GetAllStoreRequest, Error>
pub fn get_all( &self, query: Option<Query>, limit: Option<u32>, ) -> Result<GetAllStoreRequest, 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<GetAllKeysStoreRequest, Error>
pub fn get_all_keys( &self, query: Option<Query>, limit: Option<u32>, ) -> Result<GetAllKeysStoreRequest, 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<CountStoreRequest, Error>
pub fn count(&self, query: Option<Query>) -> Result<CountStoreRequest, 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<OpenCursorStoreRequest, Error>
pub fn open_cursor( &self, query: Option<Query>, cursor_direction: Option<CursorDirection>, ) -> Result<OpenCursorStoreRequest, 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<OpenKeyCursorStoreRequest, Error>
pub fn open_key_cursor( &self, query: Option<Query>, cursor_direction: Option<CursorDirection>, ) -> Result<OpenKeyCursorStoreRequest, Error>
Opens a KeyCursor
over the records matching query, ordered by direction. If query is
None
, all records in index are matched.